Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
12a9a98
1
Parent(s):
eb17cd6
fix output
Browse files
app.py
CHANGED
@@ -169,20 +169,15 @@ def generate_image(prompt, negative_prompt, width, height, steps, cfg, seed):
|
|
169 |
vae=get_value_at_index(vaeloader_80, 0),
|
170 |
)
|
171 |
|
172 |
-
#
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
# Ensure we have the right shape (height, width, channels)
|
178 |
-
if len(image_np.shape) == 4: # (batch, channel, height, width)
|
179 |
-
image_np = image_np[0] # Remove batch dimension
|
180 |
-
if len(image_np.shape) == 3: # (channel, height, width)
|
181 |
-
image_np = np.transpose(image_np, (1, 2, 0)) # Convert to (height, width, channel)
|
182 |
|
183 |
-
#
|
184 |
-
|
185 |
-
return
|
186 |
|
187 |
# Create Gradio interface
|
188 |
with gr.Blocks() as app:
|
|
|
169 |
vae=get_value_at_index(vaeloader_80, 0),
|
170 |
)
|
171 |
|
172 |
+
# Save image using SaveImage node with simple string prefix
|
173 |
+
saved = saveimage.save_images(
|
174 |
+
filename_prefix="Chroma_Generated",
|
175 |
+
images=get_value_at_index(vaedecode_79, 0),
|
176 |
+
)
|
|
|
|
|
|
|
|
|
|
|
177 |
|
178 |
+
# Return the path to the saved image
|
179 |
+
saved_path = f"output/{saved['ui']['images'][0]['filename']}"
|
180 |
+
return saved_path
|
181 |
|
182 |
# Create Gradio interface
|
183 |
with gr.Blocks() as app:
|