My-AI-Projects commited on
Commit
026d795
Β·
verified Β·
1 Parent(s): 3b42df3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,9 +1,12 @@
1
  import gradio as gr
2
- from diffusers import DiffusionPipeline
3
  import torch
 
4
 
5
- # Load the Kwai-Kolors diffusion model
6
- pipeline = DiffusionPipeline.from_pretrained("Kwai-Kolors/Kolors").to("cuda" if torch.cuda.is_available() else "cpu")
 
 
 
7
 
8
  # Function to generate image from prompt
9
  def generate_image(prompt):
 
1
  import gradio as gr
 
2
  import torch
3
+ from diffusers import KolorsPipeline
4
 
5
+ pipeline= KolorsPipeline.from_pretrained(
6
+ "Kwai-Kolors/Kolors-diffusers",
7
+ torch_dtype=torch.float16,
8
+ variant="fp16"
9
+ ).to("cuda" if torch.cuda.is_available() else "cpu")
10
 
11
  # Function to generate image from prompt
12
  def generate_image(prompt):