Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ import numpy as np
|
|
| 20 |
import pandas as pd
|
| 21 |
import plotly.graph_objects as go
|
| 22 |
import torch
|
| 23 |
-
from diffusers import
|
| 24 |
from sklearn.decomposition import PCA
|
| 25 |
|
| 26 |
# On ZeroGPU Spaces the `spaces` package provides a GPU decorator.
|
|
@@ -52,7 +52,7 @@ if not USE_SAFETY_CHECKER:
|
|
| 52 |
_pipe_kwargs.update(safety_checker=None, requires_safety_checker=False)
|
| 53 |
|
| 54 |
pipe = StableDiffusionPipeline.from_pretrained(MODEL_ID, **_pipe_kwargs)
|
| 55 |
-
pipe.scheduler =
|
| 56 |
pipe = pipe.to(DEVICE)
|
| 57 |
pipe.set_progress_bar_config(disable=True)
|
| 58 |
|
|
@@ -393,7 +393,7 @@ with gr.Blocks(title="Text Embedding Explorer for Stable Diffusion 1.5") as demo
|
|
| 393 |
|
| 394 |
with gr.Accordion("Generation settings (shared by all tabs)", open=False):
|
| 395 |
with gr.Row():
|
| 396 |
-
steps = gr.Slider(
|
| 397 |
cfg = gr.Slider(1, 15, value=7.5, step=0.5, label="Guidance scale")
|
| 398 |
size = gr.Dropdown([384, 448, 512], value=512, label="Image size (px)")
|
| 399 |
with gr.Row():
|
|
|
|
| 20 |
import pandas as pd
|
| 21 |
import plotly.graph_objects as go
|
| 22 |
import torch
|
| 23 |
+
from diffusers import StableDiffusionPipeline, UniPCMultistepScheduler
|
| 24 |
from sklearn.decomposition import PCA
|
| 25 |
|
| 26 |
# On ZeroGPU Spaces the `spaces` package provides a GPU decorator.
|
|
|
|
| 52 |
_pipe_kwargs.update(safety_checker=None, requires_safety_checker=False)
|
| 53 |
|
| 54 |
pipe = StableDiffusionPipeline.from_pretrained(MODEL_ID, **_pipe_kwargs)
|
| 55 |
+
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
|
| 56 |
pipe = pipe.to(DEVICE)
|
| 57 |
pipe.set_progress_bar_config(disable=True)
|
| 58 |
|
|
|
|
| 393 |
|
| 394 |
with gr.Accordion("Generation settings (shared by all tabs)", open=False):
|
| 395 |
with gr.Row():
|
| 396 |
+
steps = gr.Slider(8, 48, value=16, step=1, label="Steps")
|
| 397 |
cfg = gr.Slider(1, 15, value=7.5, step=0.5, label="Guidance scale")
|
| 398 |
size = gr.Dropdown([384, 448, 512], value=512, label="Image size (px)")
|
| 399 |
with gr.Row():
|