samthakur commited on
Commit
2a5dfa3
·
1 Parent(s): d617dfe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -1,13 +1,13 @@
1
- def diffusion(text,num_inference_steps,guidance_scale):
2
- from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
3
-
4
- model_id = "stabilityai/stable-diffusion-2-1"
5
 
6
- # Use the DPMSolverMultistepScheduler (DPM-Solver++) scheduler here instead
7
- pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
8
- pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
9
- pipe = pipe.to("cuda")
10
 
 
 
 
 
 
11
  prompt = text
12
  image = pipe(prompt,guidance_scale=guidance_scale, num_inference_steps=num_inference_steps).images[0]
13
  return image
 
1
+ import gradio as gr
2
+ from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
 
 
3
 
4
+ model_id = "stabilityai/stable-diffusion-2-1"
 
 
 
5
 
6
+ # Use the DPMSolverMultistepScheduler (DPM-Solver++) scheduler here instead
7
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
8
+ pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
9
+ pipe = pipe.to("cuda")
10
+ def diffusion(text,num_inference_steps,guidance_scale):
11
  prompt = text
12
  image = pipe(prompt,guidance_scale=guidance_scale, num_inference_steps=num_inference_steps).images[0]
13
  return image