Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,11 +4,12 @@ from diffusers import StableDiffusionPipeline
|
|
| 4 |
|
| 5 |
# ΨͺΨΩ
ΩΩ ΩΩ
ΩΨ°Ψ¬ Stable Diffusion
|
| 6 |
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
|
| 7 |
-
pipe = pipe.to("cuda")
|
| 8 |
-
|
| 9 |
# ΩΨΈΩΩΨ© ΩΨͺΩΩΩΨ― Ψ§ΩΨ΅ΩΨ± Ψ¨ΩΨ§Ψ‘Ω ΨΉΩΩ Ψ§ΩΩΨ΅Ω Ψ§ΩΩΨ΅Ω
|
| 10 |
def generate_image(prompt):
|
| 11 |
-
image = pipe(prompt).images[0]
|
|
|
|
| 12 |
return image
|
| 13 |
|
| 14 |
# Ψ₯ΩΨ΄Ψ§Ψ‘ ΩΨ§Ψ¬ΩΨ© Gradio
|
|
|
|
| 4 |
|
| 5 |
# ΨͺΨΩ
ΩΩ ΩΩ
ΩΨ°Ψ¬ Stable Diffusion
|
| 6 |
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
|
| 7 |
+
#pipe = pipe.to("cuda")
|
| 8 |
+
pipe = pipe.to("cpu")
|
| 9 |
# ΩΨΈΩΩΨ© ΩΨͺΩΩΩΨ― Ψ§ΩΨ΅ΩΨ± Ψ¨ΩΨ§Ψ‘Ω ΨΉΩΩ Ψ§ΩΩΨ΅Ω Ψ§ΩΩΨ΅Ω
|
| 10 |
def generate_image(prompt):
|
| 11 |
+
#image = pipe(prompt).images[0]
|
| 12 |
+
image = pipe(prompt, height=256, width=256).images[0]
|
| 13 |
return image
|
| 14 |
|
| 15 |
# Ψ₯ΩΨ΄Ψ§Ψ‘ ΩΨ§Ψ¬ΩΨ© Gradio
|