Spaces:
Runtime error

Tac39 commited on
Commit
797f4e0
Β·
verified Β·
1 Parent(s): 10e1d9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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