Spaces:
Runtime error
Runtime error
code update
Browse files
app.py
CHANGED
@@ -249,7 +249,12 @@ def display_images_in_rows(images_with_titles, titles):
|
|
249 |
plt.show()
|
250 |
|
251 |
def image_generator(prompt = "dog", loss_function=None):
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
253 |
images_without_loss = []
|
254 |
images_with_loss = []
|
255 |
|
@@ -290,7 +295,7 @@ def image_generator_wrapper(prompt = "dog", loss_function=None):
|
|
290 |
|
291 |
description = "Generate an image with a prompt and apply loss if you wish to"
|
292 |
|
293 |
-
demo = gr.Interface(
|
294 |
inputs=[gr.Textbox(label="Enter prompt for generating", type="text", value="dog sitting on a bench"),
|
295 |
gr.Radio(["Yes", "No"], value="No" , label="Apply vibrance loss")],
|
296 |
outputs=gr.Plot(label="Outputs"), title = "Stable Diffusion", description=description)
|
|
|
249 |
plt.show()
|
250 |
|
251 |
def image_generator(prompt = "dog", loss_function=None):
|
252 |
+
|
253 |
+
if loss_function == "Yes":
|
254 |
+
loss_function = vibrance_loss
|
255 |
+
else:
|
256 |
+
loss_function = None
|
257 |
+
|
258 |
images_without_loss = []
|
259 |
images_with_loss = []
|
260 |
|
|
|
295 |
|
296 |
description = "Generate an image with a prompt and apply loss if you wish to"
|
297 |
|
298 |
+
demo = gr.Interface(image_generator,
|
299 |
inputs=[gr.Textbox(label="Enter prompt for generating", type="text", value="dog sitting on a bench"),
|
300 |
gr.Radio(["Yes", "No"], value="No" , label="Apply vibrance loss")],
|
301 |
outputs=gr.Plot(label="Outputs"), title = "Stable Diffusion", description=description)
|