Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,14 +74,8 @@ def generate(
|
|
| 74 |
}
|
| 75 |
|
| 76 |
images = model(**options).images
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
# Save the image and create a caption (we use the filename as the caption)
|
| 80 |
-
image_path = save_image(img)
|
| 81 |
-
caption = os.path.basename(image_path) # Use the filename as the caption
|
| 82 |
-
image_paths.append((image_path, caption)) # Add the image and caption as a tuple
|
| 83 |
-
|
| 84 |
-
return image_paths, seed
|
| 85 |
|
| 86 |
with gr.Blocks(theme="soft") as demo:
|
| 87 |
# Centered text "SNAPSCRIBE" at the top of the screen
|
|
@@ -97,12 +91,12 @@ with gr.Blocks(theme="soft") as demo:
|
|
| 97 |
run_button = gr.Button("Generate Image")
|
| 98 |
gr.Markdown("Developed using the RealVisXL_V5.0_Lightning model.", elem_id="model_info")
|
| 99 |
with gr.Column(scale=7):
|
| 100 |
-
|
| 101 |
|
| 102 |
run_button.click(
|
| 103 |
fn=generate,
|
| 104 |
inputs=[prompt],
|
| 105 |
-
outputs=[
|
| 106 |
)
|
| 107 |
|
| 108 |
# Footer with custom style and text
|
|
|
|
| 74 |
}
|
| 75 |
|
| 76 |
images = model(**options).images
|
| 77 |
+
image_path = save_image(images[0]) # Saving the first generated image
|
| 78 |
+
return image_path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
with gr.Blocks(theme="soft") as demo:
|
| 81 |
# Centered text "SNAPSCRIBE" at the top of the screen
|
|
|
|
| 91 |
run_button = gr.Button("Generate Image")
|
| 92 |
gr.Markdown("Developed using the RealVisXL_V5.0_Lightning model.", elem_id="model_info")
|
| 93 |
with gr.Column(scale=7):
|
| 94 |
+
result_image = gr.Image(label="Generated Image", type="filepath")
|
| 95 |
|
| 96 |
run_button.click(
|
| 97 |
fn=generate,
|
| 98 |
inputs=[prompt],
|
| 99 |
+
outputs=[result_image],
|
| 100 |
)
|
| 101 |
|
| 102 |
# Footer with custom style and text
|