Update app.py
Browse files
app.py
CHANGED
@@ -161,26 +161,6 @@ def create_interface():
|
|
161 |
api_name="generate_random_prompt_with_llm"
|
162 |
)
|
163 |
|
164 |
-
# Add image generation button
|
165 |
-
generate_image_button = gr.Button("Generate Image")
|
166 |
-
|
167 |
-
# Function to generate image
|
168 |
-
def generate_image(text):
|
169 |
-
try:
|
170 |
-
seed = random.randint(0, 1000000)
|
171 |
-
image_path = llm_node.generate_image(text, seed=seed)
|
172 |
-
print(f"Image generated: {image_path}")
|
173 |
-
return image_path
|
174 |
-
except Exception as e:
|
175 |
-
print(f"An error occurred while generating the image: {e}")
|
176 |
-
return None
|
177 |
-
|
178 |
-
# Connect the image generation button
|
179 |
-
generate_image_button.click(
|
180 |
-
generate_image,
|
181 |
-
inputs=[text_output],
|
182 |
-
outputs=[image_output]
|
183 |
-
)
|
184 |
|
185 |
return demo
|
186 |
|
|
|
161 |
api_name="generate_random_prompt_with_llm"
|
162 |
)
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
return demo
|
166 |
|