Update app.py
Browse files
app.py
CHANGED
|
@@ -72,16 +72,9 @@ def gen_fn(model_str, prompt, negative_prompt):
|
|
| 72 |
print(f"Generating with prompt: {combined_prompt}")
|
| 73 |
|
| 74 |
try:
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
image_response = models_load[model_str](f'{combined_prompt}')
|
| 79 |
-
# Check if the image_response is a tuple, handle accordingly
|
| 80 |
-
# if isinstance(image_response, tuple):
|
| 81 |
-
# print(f"{image_response}")
|
| 82 |
-
# # If the response is a tuple, assume the first item is the image
|
| 83 |
-
# image_response = image_response[0]
|
| 84 |
-
|
| 85 |
# Ensure the response is an image or image-like object
|
| 86 |
if isinstance(image_response, gr.Image):
|
| 87 |
return image_response
|
|
@@ -93,8 +86,7 @@ def gen_fn(model_str, prompt, negative_prompt):
|
|
| 93 |
except Exception as e:
|
| 94 |
print(f"Error occurred: {e}")
|
| 95 |
return None
|
| 96 |
-
|
| 97 |
-
|
| 98 |
|
| 99 |
|
| 100 |
def make_me():
|
|
@@ -105,7 +97,7 @@ def make_me():
|
|
| 105 |
stop_button = gr.Button('Stop', variant='secondary', interactive=False)
|
| 106 |
gen_button.click(lambda _: gr.update(interactive=True), None, stop_button)
|
| 107 |
|
| 108 |
-
log_output = gr.Textbox(label="Logs", lines=
|
| 109 |
log_button = gr.Button("Start Logging")
|
| 110 |
log_button.click(log_message, outputs=log_output)
|
| 111 |
|
|
|
|
| 72 |
print(f"Generating with prompt: {combined_prompt}")
|
| 73 |
|
| 74 |
try:
|
| 75 |
+
image_response = models_load[model_str](f'{prompt} {negative_prompt} {noise}')
|
| 76 |
+
# print(f"77 {models_load[model_str](f'{combined_prompt}')}")
|
| 77 |
+
# image_response = models_load[model_str](f'{combined_prompt}')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
# Ensure the response is an image or image-like object
|
| 79 |
if isinstance(image_response, gr.Image):
|
| 80 |
return image_response
|
|
|
|
| 86 |
except Exception as e:
|
| 87 |
print(f"Error occurred: {e}")
|
| 88 |
return None
|
| 89 |
+
|
|
|
|
| 90 |
|
| 91 |
|
| 92 |
def make_me():
|
|
|
|
| 97 |
stop_button = gr.Button('Stop', variant='secondary', interactive=False)
|
| 98 |
gen_button.click(lambda _: gr.update(interactive=True), None, stop_button)
|
| 99 |
|
| 100 |
+
log_output = gr.Textbox(label="Logs", lines=2, interactive=False)
|
| 101 |
log_button = gr.Button("Start Logging")
|
| 102 |
log_button.click(log_message, outputs=log_output)
|
| 103 |
|