Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,18 +55,19 @@ def generate(
|
|
| 55 |
model = 'SG161222/Realistic_Vision_V6.0_B1_noVAE',
|
| 56 |
vaecall = 'stabilityai/sd-vae-ft-mse',
|
| 57 |
lora = 'amazonaws-la/juliette',
|
|
|
|
| 58 |
lora_scale: float = 0.7,
|
| 59 |
) -> PIL.Image.Image:
|
| 60 |
if torch.cuda.is_available():
|
| 61 |
|
| 62 |
if not use_vae:
|
| 63 |
pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch.float16)
|
| 64 |
-
pipe.scheduler =
|
| 65 |
|
| 66 |
if use_vae:
|
| 67 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
| 68 |
pipe = DiffusionPipeline.from_pretrained(model, vae=vae, torch_dtype=torch.float16)
|
| 69 |
-
pipe.scheduler =
|
| 70 |
|
| 71 |
if use_lora:
|
| 72 |
pipe.load_lora_weights(lora)
|
|
@@ -142,6 +143,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 142 |
visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
|
| 143 |
)
|
| 144 |
with gr.Group():
|
|
|
|
| 145 |
model = gr.Text(label='Modelo')
|
| 146 |
vaecall = gr.Text(label='VAE')
|
| 147 |
lora = gr.Text(label='LoRA')
|
|
@@ -330,6 +332,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 330 |
model,
|
| 331 |
vaecall,
|
| 332 |
lora,
|
|
|
|
| 333 |
lora_scale,
|
| 334 |
],
|
| 335 |
outputs=result,
|
|
|
|
| 55 |
model = 'SG161222/Realistic_Vision_V6.0_B1_noVAE',
|
| 56 |
vaecall = 'stabilityai/sd-vae-ft-mse',
|
| 57 |
lora = 'amazonaws-la/juliette',
|
| 58 |
+
sampler = 'EulerAncestralDiscreteScheduler',
|
| 59 |
lora_scale: float = 0.7,
|
| 60 |
) -> PIL.Image.Image:
|
| 61 |
if torch.cuda.is_available():
|
| 62 |
|
| 63 |
if not use_vae:
|
| 64 |
pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch.float16)
|
| 65 |
+
pipe.scheduler = sampler.from_config(pipe.scheduler.config)
|
| 66 |
|
| 67 |
if use_vae:
|
| 68 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
| 69 |
pipe = DiffusionPipeline.from_pretrained(model, vae=vae, torch_dtype=torch.float16)
|
| 70 |
+
pipe.scheduler = sampler.from_config(pipe.scheduler.config)
|
| 71 |
|
| 72 |
if use_lora:
|
| 73 |
pipe.load_lora_weights(lora)
|
|
|
|
| 143 |
visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
|
| 144 |
)
|
| 145 |
with gr.Group():
|
| 146 |
+
sampler = gr.Text(label='Sampler', value='EulerAncestralDiscreteScheduler')
|
| 147 |
model = gr.Text(label='Modelo')
|
| 148 |
vaecall = gr.Text(label='VAE')
|
| 149 |
lora = gr.Text(label='LoRA')
|
|
|
|
| 332 |
model,
|
| 333 |
vaecall,
|
| 334 |
lora,
|
| 335 |
+
sampler,
|
| 336 |
lora_scale,
|
| 337 |
],
|
| 338 |
outputs=result,
|