jiuface commited on
Commit
66437b5
1 Parent(s): 2008ad3

update gradio interface

Browse files
Files changed (1) hide show
  1. app.py +37 -20
app.py CHANGED
@@ -21,10 +21,6 @@ MAX_SEED = np.iinfo(np.int32).max
21
  IMAGE_SIZE = 1024
22
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
23
  HF_TOKEN = os.environ.get("HF_TOKEN")
24
- trigger_word = "a_photo_of_TOK"
25
- # lora_path = "jiuface/boy-001"
26
- # lora_weights = "flux_train_replicate.safetensors"
27
- lora_scale = 0.9
28
 
29
  login(token=HF_TOKEN)
30
 
@@ -99,6 +95,8 @@ def process(
99
  input_image_editor: dict,
100
  lora_path: str,
101
  lora_weights: str,
 
 
102
  input_text: str,
103
  seed_slicer: int,
104
  randomize_seed_checkbox: bool,
@@ -161,35 +159,52 @@ with gr.Blocks() as demo:
161
  layers=False,
162
  brush=gr.Brush(colors=["#FFFFFF"], color_mode="fixed"))
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  with gr.Accordion("Lora Settings", open=True):
165
- lora_path = gr.Text(
166
  label="Lora path",
167
  show_label=True,
168
  max_lines=1,
169
- placeholder="Enter your lora path",
170
- container=False,
171
  )
172
- lora_weights = gr.Text(
173
  label="Lora weights",
174
  show_label=True,
175
  max_lines=1,
176
- placeholder="Enter your lora weights",
177
- container=False,
178
  )
179
-
180
- with gr.Row():
181
- input_text_component = gr.Text(
182
- label="Prompt",
183
  show_label=True,
184
- max_lines=1,
185
- placeholder="Enter your prompt",
186
- container=False,
 
187
  )
188
 
189
- submit_button_component = gr.Button(
190
- value='Submit', variant='primary', scale=0)
191
-
192
  with gr.Accordion("Advanced Settings", open=True):
 
 
193
  seed_slicer_component = gr.Slider(
194
  label="Seed",
195
  minimum=0,
@@ -235,6 +250,8 @@ with gr.Blocks() as demo:
235
  input_image_editor_component,
236
  lora_path,
237
  lora_weights,
 
 
238
  input_text_component,
239
  seed_slicer_component,
240
  randomize_seed_checkbox_component,
 
21
  IMAGE_SIZE = 1024
22
  DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
23
  HF_TOKEN = os.environ.get("HF_TOKEN")
 
 
 
 
24
 
25
  login(token=HF_TOKEN)
26
 
 
95
  input_image_editor: dict,
96
  lora_path: str,
97
  lora_weights: str,
98
+ lora_scale: float,
99
+ trigger_word: str,
100
  input_text: str,
101
  seed_slicer: int,
102
  randomize_seed_checkbox: bool,
 
159
  layers=False,
160
  brush=gr.Brush(colors=["#FFFFFF"], color_mode="fixed"))
161
 
162
+
163
+ with gr.Accordion("Prompt Settings", open=True):
164
+
165
+ input_text_component = gr.Textbox(
166
+ label="Inpaint prompt",
167
+ show_label=True,
168
+ max_lines=1,
169
+ placeholder="Enter your prompt",
170
+ )
171
+ trigger_word = gr.Textbox(
172
+ label="Lora trigger word",
173
+ show_label=True,
174
+ max_lines=1,
175
+ placeholder="Enter your lora trigger word here",
176
+ value="a photo of TOK"
177
+
178
+ )
179
+
180
+ submit_button_component = gr.Button(
181
+ value='Submit', variant='primary', scale=0)
182
+
183
  with gr.Accordion("Lora Settings", open=True):
184
+ lora_path = gr.Textbox(
185
  label="Lora path",
186
  show_label=True,
187
  max_lines=1,
188
+ placeholder="Enter your lora's model path",
 
189
  )
190
+ lora_weights = gr.Textbox(
191
  label="Lora weights",
192
  show_label=True,
193
  max_lines=1,
194
+ placeholder="Enter your lora weights name",
 
195
  )
196
+ lora_scale = gr.Slider(
197
+ label="Lora scale",
 
 
198
  show_label=True,
199
+ minimum=0,
200
+ maximum=1,
201
+ step=0.1,
202
+ value=0.8,
203
  )
204
 
 
 
 
205
  with gr.Accordion("Advanced Settings", open=True):
206
+
207
+
208
  seed_slicer_component = gr.Slider(
209
  label="Seed",
210
  minimum=0,
 
250
  input_image_editor_component,
251
  lora_path,
252
  lora_weights,
253
+ lora_scale,
254
+ trigger_word,
255
  input_text_component,
256
  seed_slicer_component,
257
  randomize_seed_checkbox_component,