Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -50,7 +50,7 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
50 |
).to(device)
|
51 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
52 |
|
53 |
-
#
|
54 |
if USE_TORCH_COMPILE:
|
55 |
pipe.compile()
|
56 |
|
@@ -103,7 +103,7 @@ def generate(
|
|
103 |
if use_resolution_binning:
|
104 |
options["use_resolution_binning"] = True
|
105 |
|
106 |
-
#
|
107 |
images = []
|
108 |
for i in range(0, num_images, BATCH_SIZE):
|
109 |
batch_options = options.copy()
|
@@ -128,7 +128,8 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
|
128 |
)
|
129 |
run_button = gr.Button("Run", scale=0, variant="primary")
|
130 |
|
131 |
-
|
|
|
132 |
|
133 |
with gr.Accordion("Advanced options", open=False, visible=True):
|
134 |
num_images = gr.Slider(
|
|
|
50 |
).to(device)
|
51 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
52 |
|
53 |
+
# Compile speedup
|
54 |
if USE_TORCH_COMPILE:
|
55 |
pipe.compile()
|
56 |
|
|
|
103 |
if use_resolution_binning:
|
104 |
options["use_resolution_binning"] = True
|
105 |
|
106 |
+
# Generate images in batches
|
107 |
images = []
|
108 |
for i in range(0, num_images, BATCH_SIZE):
|
109 |
batch_options = options.copy()
|
|
|
128 |
)
|
129 |
run_button = gr.Button("Run", scale=0, variant="primary")
|
130 |
|
131 |
+
# Changed from gr.Image to gr.Gallery to handle multiple images
|
132 |
+
result = gr.Gallery(label="Result", columns=2, show_label=False)
|
133 |
|
134 |
with gr.Accordion("Advanced options", open=False, visible=True):
|
135 |
num_images = gr.Slider(
|