lelafav502 commited on
Commit
33b6596
·
verified ·
1 Parent(s): b2ec1fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
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
- img_url = gr.Textbox(label="URL")
204
- img_mask = gr.Textbox(label="Mask URL")
205
- img_prompt = gr.Textbox(label="Prompt")
206
- img_ratio = gr.Textbox(label="Ratio")
207
- img_uuid = gr.Textbox(label="UUID ID") # Default UUID
208
- img_token = gr.Textbox(label="Token ID") # Password type for token
209
- img_output = gr.Textbox() # Output for image-to-image response
 
210
 
211
  # Bind the image-to-image function to the interface
212
- img_submit_button = gr.Button("Generate Image")
213
- img_submit_button.click(send_inpaint2image_request, inputs=[img_url, img_mask, img_prompt, img_ratio, img_uuid, img_token], outputs=img_output)
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