Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from diffusers import DiffusionPipeline
|
| 3 |
import torch
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
| 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):
|