Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ def send_image2image_request(image, ratio, style, uuid_value, token):
|
|
74 |
return f"Error: {response.status_code} - {response.text}"
|
75 |
|
76 |
# Function for Image-to-Image (Send POST request with an image and other parameters)
|
77 |
-
def send_inpaint2image_request(image, mask, prompt, ratio, uuid_value, token):
|
78 |
# Access the URL from Secrets (Private)
|
79 |
url = os.getenv('API_URL_IMAGE') # Secret variable for the URL
|
80 |
if not url:
|
@@ -200,17 +200,18 @@ def create_interface():
|
|
200 |
|
201 |
with gr.Tab("Inpaint Image"):
|
202 |
# Inputs for Inpaint-to-Image
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
|
|
210 |
|
211 |
# Bind the image-to-image function to the interface
|
212 |
-
|
213 |
-
|
214 |
|
215 |
with gr.Tab("Get Upload URL"):
|
216 |
# Inputs for Get Upload URL
|
|
|
74 |
return f"Error: {response.status_code} - {response.text}"
|
75 |
|
76 |
# Function for Image-to-Image (Send POST request with an image and other parameters)
|
77 |
+
def send_inpaint2image_request(image, mask, prompt, ratio, uuid_value, token, style):
|
78 |
# Access the URL from Secrets (Private)
|
79 |
url = os.getenv('API_URL_IMAGE') # Secret variable for the URL
|
80 |
if not url:
|
|
|
200 |
|
201 |
with gr.Tab("Inpaint Image"):
|
202 |
# Inputs for Inpaint-to-Image
|
203 |
+
in_url = gr.Textbox(label="URL")
|
204 |
+
in_mask = gr.Textbox(label="Mask URL")
|
205 |
+
in_prompt = gr.Textbox(label="Prompt")
|
206 |
+
in_ratio = gr.Textbox(label="Ratio")
|
207 |
+
in_uuid = gr.Textbox(label="UUID ID") # Default UUID
|
208 |
+
in_token = gr.Textbox(label="Token ID")
|
209 |
+
in_style = gr.Textbox(label="Style ID") # Password type for token
|
210 |
+
in_output = gr.Textbox() # Output for image-to-image response
|
211 |
|
212 |
# Bind the image-to-image function to the interface
|
213 |
+
in_submit_button = gr.Button("Generate Image")
|
214 |
+
in_submit_button.click(send_inpaint2image_request, inputs=[in_url, in_mask, in_prompt, in_ratio, in_uuid, in_token, in_style], outputs=in_output)
|
215 |
|
216 |
with gr.Tab("Get Upload URL"):
|
217 |
# Inputs for Get Upload URL
|