Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
model_id = "stabilityai/stable-diffusion-2-1"
|
| 5 |
|
| 6 |
-
|
| 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
|