DigiP-AI commited on
Commit
3eb3ca8
·
verified ·
1 Parent(s): 148cea1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +56 -33
app.py CHANGED
@@ -126,7 +126,7 @@ examples = [
126
 
127
  css = """
128
  #app-container {
129
- max-width: 600px;
130
  margin-left: auto;
131
  margin-right: auto;
132
  }
@@ -135,39 +135,62 @@ css = """
135
  with gr.Blocks(theme=theme, css=css) as app:
136
  gr.HTML("<center><h1>FLUX.1-Dev with LoRA support</h1></center>")
137
  with gr.Column(elem_id="app-container"):
138
- with gr.Row():
139
- with gr.Column(elem_id="prompt-container"):
140
- with gr.Row():
141
- text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=2, elem_id="prompt-text-input")
142
- with gr.Row():
143
- custom_lora = gr.Textbox(label="Custom LoRA", info="LoRA Hugging Face path (optional)", placeholder="multimodalart/vintage-ads-flux")
144
- with gr.Row():
145
- with gr.Accordion("Advanced Settings", open=False):
146
- with gr.Row():
147
- width = gr.Slider(label="Width", value=1024, minimum=64, maximum=1216, step=8)
148
- height = gr.Slider(label="Height", value=1024, minimum=64, maximum=1216, step=8)
149
- seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=4294967296, step=1)
150
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
151
- with gr.Row():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  steps = gr.Slider(label="Sampling steps", value=28, minimum=1, maximum=100, step=1)
153
  cfg = gr.Slider(label="CFG Scale", value=3.5, minimum=1, maximum=20, step=0.5)
154
- # method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
155
-
156
- with gr.Row():
157
- text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
158
- with gr.Row():
159
- image_output = gr.Image(type="pil", label="Image Output", elem_id="gallery")
160
- with gr.Row():
161
- seed_output = gr.Textbox(label="Seed Used", show_copy_button = True, elem_id="seed-output")
162
-
163
- gr.Markdown(article_text)
164
-
165
- gr.Examples(
166
- examples = examples,
167
- inputs = [text_prompt],
168
- )
169
-
170
-
171
- text_button.click(query, inputs=[custom_lora, text_prompt, steps, cfg, randomize_seed, seed, width, height], outputs=[image_output,seed_output, seed])
 
 
 
 
172
 
173
  app.launch(show_api=False, share=False)
 
126
 
127
  css = """
128
  #app-container {
129
+ max-width: 896px;
130
  margin-left: auto;
131
  margin-right: auto;
132
  }
 
135
  with gr.Blocks(theme=theme, css=css) as app:
136
  gr.HTML("<center><h1>FLUX.1-Dev with LoRA support</h1></center>")
137
  with gr.Column(elem_id="app-container"):
138
+ with gr.Row():
139
+ with gr.Column(elem_id="prompt-container"):
140
+ with gr.Row():
141
+ text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=2, elem_id="prompt-text-input")
142
+ with gr.Row():
143
+ with gr.Accordion("Lora trigger words", open=False):
144
+ gr.Markdown("""
145
+ - **sdxl-realistic**: szn style
146
+ - **stylesdxl-cyberpunk**: szn style
147
+ - **maxfield-parrish-stylee**: Maxfield Parrish Style
148
+ - **surreal-harmony**: Surreal Harmony
149
+ - **extremely-detailed**: extremely detailed
150
+ - **dark-fantasy**: Dark Fantasy
151
+ - **analogredmond**: AnalogRedmAF
152
+ - **jules-bastien-lepage-style**: Jules Bastien Lepage Style
153
+ - **john-singer-sargent-style**: John Singer Sargent Style
154
+ - **alphonse-mucha-style**: Alphonse Mucha Style
155
+ - **ultra-realistic-illustration**: ultra realistic illustration
156
+ - **eye-catching**: eye-catching
157
+ - **john-constable-style**: John Constable Style
158
+ - **film-noir**: in the style of FLMNR
159
+ - **director-sofia-coppola-style**: Director Sofia Coppola Style
160
+ """,
161
+ label="Trigger words")
162
+
163
+ with gr.Row():
164
+ custom_lora = gr.Dropdown([" ", "jwu114/lora-sdxl-realistic", "issaccyj/lora-sdxl-cyberpunk", "KappaNeuro/maxfield-parrish-style", "fofr/sdxl-deep-down", "KappaNeuro/surreal-harmony", "ntc-ai/SDXL-LoRA-slider.extremely-detailed", "prithivMLmods/Canopus-LoRA-Flux-FaceRealism", "KappaNeuro/dark-fantasy", "artificialguybr/analogredmond", "KappaNeuro/jules-bastien-lepage-style", "KappaNeuro/john-singer-sargent-style", "KappaNeuro/alphonse-mucha-style", "ntc-ai/SDXL-LoRA-slider.ultra-realistic-illustration", "ntc-ai/SDXL-LoRA-slider.eye-catching", "KappaNeuro/john-constable-style", "dvyio/flux-lora-film-noir", "KappaNeuro/director-sofia-coppola-style"], label="Custom LoRA (Please select)",)
165
+ with gr.Row():
166
+ with gr.Accordion("⚙️ Advanced Settings", open=False, elem_id="settings-container"):
167
+ negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What should not be in the image", value="((((out of frame))), deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos", lines=3, elem_id="negative-prompt-text-input")
168
+ with gr.Row():
169
+ width = gr.Slider(label="Width", value=1024, minimum=64, maximum=1216, step=32)
170
+ height = gr.Slider(label="Height", value=1024, minimum=64, maximum=1216, step=32)
171
  steps = gr.Slider(label="Sampling steps", value=28, minimum=1, maximum=100, step=1)
172
  cfg = gr.Slider(label="CFG Scale", value=3.5, minimum=1, maximum=20, step=0.5)
173
+ method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "DPM Fast" "Euler", "Euler a", "Euler+beta", "Heun", "DDIM", "PLMS", "UniPC"])
174
+ strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
175
+ seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
176
+ with gr.Row():
177
+ with gr.Accordion("🫘Seed", open=False):
178
+ seed_output = gr.Textbox(label="Seed Used", show_copy_button = True, elem_id="seed-output")
179
+
180
+ with gr.Row():
181
+ text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
182
+ with gr.Row():
183
+ clr_button =gr.Button("Clear",variant="primary", elem_id="clear_button")
184
+ clr_button.click(lambda: gr.Textbox(value=""), None, text_prompt)
185
+
186
+ with gr.Row():
187
+ image_output = gr.Image(type="pil", label="Image Output", format="png", elem_id="gallery")
188
+
189
+ gr.Examples(
190
+ examples = examples,
191
+ inputs = [text_prompt],
192
+ )
193
+
194
+ text_button.click(query, inputs=[custom_lora, text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=[image_output, seed_output])
195
 
196
  app.launch(show_api=False, share=False)