DigiP-AI commited on
Commit
b6c0bd5
Β·
verified Β·
1 Parent(s): d9f945b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -157,7 +157,19 @@ with gr.Blocks(theme=theme, css=css) as app:
157
  # Add a title to the app
158
  gr.HTML("<center><h1>🎨 Stable Diffusion 3.5 large turbo πŸ‡¬πŸ‡§</h1></center>")
159
  with gr.Tabs() as tabs:
160
- with gr.TabItem("Text to Image", id=0):
 
 
 
 
 
 
 
 
 
 
 
 
161
  # Container for all the UI elements
162
  with gr.Column(elem_id="app-container"):
163
  # Add a text input for the main prompt
@@ -201,19 +213,7 @@ with gr.Blocks(theme=theme, css=css) as app:
201
 
202
  # Bind the button to the query function with the added width and height inputs
203
  text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=image_output)
204
-
205
- with gr.TabItem(label="Image To Prompt", visible=True, id=1):
206
- with gr.Row():
207
- with gr.Column():
208
- input_img = gr.Image(label="Input Picture",height=320,type="filepath")
209
- submit_btn = gr.Button(value="Submit", variant='primary')
210
- with gr.Column():
211
- output_text = gr.Textbox(label="Flux Prompt", show_copy_button = True)
212
- clr_button =gr.Button("Clear",variant="primary", elem_id="clear_button")
213
- clr_button.click(lambda: gr.Textbox(value=""), None, output_text)
214
-
215
- submit_btn.click(feifeichat, [input_img], [output_text])
216
-
217
 
218
  app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
219
  if __name__ == "__main__":
 
157
  # Add a title to the app
158
  gr.HTML("<center><h1>🎨 Stable Diffusion 3.5 large turbo πŸ‡¬πŸ‡§</h1></center>")
159
  with gr.Tabs() as tabs:
160
+
161
+ with gr.TabItem(label="Image To Prompt", visible=True, id=1):
162
+ with gr.Column():
163
+ input_img = gr.Image(label="Input Picture",height=320,type="filepath")
164
+ submit_btn = gr.Button(value="Submit", variant='primary')
165
+ with gr.Column():
166
+ output_text = gr.Textbox(label="Flux Prompt", show_copy_button = True)
167
+ clr_button =gr.Button("Clear",variant="primary", elem_id="clear_button")
168
+ clr_button.click(lambda: gr.Textbox(value=""), None, output_text)
169
+
170
+ submit_btn.click(feifeichat, [input_img], [output_text])
171
+
172
+ with gr.TabItem("Text to Image", visible=True, id=0):
173
  # Container for all the UI elements
174
  with gr.Column(elem_id="app-container"):
175
  # Add a text input for the main prompt
 
213
 
214
  # Bind the button to the query function with the added width and height inputs
215
  text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=image_output)
216
+
 
 
 
 
 
 
 
 
 
 
 
 
217
 
218
  app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
219
  if __name__ == "__main__":