yuvaranianandhan24 commited on
Commit
b00bfb2
1 Parent(s): d2898bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -70,14 +70,14 @@ def txt2speech(text):
70
 
71
  # text-to- image
72
  def txt2img(text, style="realistic"):
73
- #model_id = "stabilityai/stable-diffusion-2"
74
- pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
75
 
76
  # Use the Euler scheduler here instead
77
- #scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
78
- #pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
79
- #pipe = pipe.to("cuda")
80
- image = pipeline(prompt = text, guidance_scale = 7.5).images[0]
81
  return image
82
 
83
 
 
70
 
71
  # text-to- image
72
  def txt2img(text, style="realistic"):
73
+ model_id = "stabilityai/stable-diffusion-2"
74
+ #pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
75
 
76
  # Use the Euler scheduler here instead
77
+ scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
78
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
79
+ pipe = pipe.to("cuda")
80
+ image = pipe(prompt = text, guidance_scale = 7.5).images[0]
81
  return image
82
 
83