Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,30 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
gr.load("models/cutycat2000/InterDiffusion-2.5").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
gr.load("models/cutycat2000/InterDiffusion-2.5").launch()
|
| 4 |
+
from diffusers import (
|
| 5 |
+
StableDiffusionXLPipeline,
|
| 6 |
+
KDPM2AncestralDiscreteScheduler,
|
| 7 |
+
AutoencoderKL
|
| 8 |
+
)
|
| 9 |
+
vae = AutoencoderKL.from_pretrained(
|
| 10 |
+
"madebyollin/sdxl-vae-fp16-fix",
|
| 11 |
+
torch_dtype=torch.float16
|
| 12 |
+
)
|
| 13 |
+
pipe = StableDiffusionXLPipeline.from_pretrained(
|
| 14 |
+
"cutycat2000/InterDiffusion-2.5",
|
| 15 |
+
vae=vae,
|
| 16 |
+
torch_dtype=torch.float16
|
| 17 |
+
)
|
| 18 |
+
pipe.scheduler = KDPM2AncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 19 |
+
pipe.to('cuda')
|
| 20 |
+
prompt = "Hello World"
|
| 21 |
+
negative_prompt = "text"
|
| 22 |
+
|
| 23 |
+
image = pipe(
|
| 24 |
+
prompt,
|
| 25 |
+
negative_prompt=negative_prompt,
|
| 26 |
+
width=1024,
|
| 27 |
+
height=1024,
|
| 28 |
+
guidance_scale=7,
|
| 29 |
+
num_inference_steps=20
|
| 30 |
+
).images[0]
|