fountai commited on
Commit
4d06751
1 Parent(s): 787f2e8

customizable images

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -21,7 +21,7 @@ hf_hub_download("XLabs-AI/flux-controlnet-canny", "controlnet.safetensors")
21
  print("downloaded!")
22
 
23
  @spaces.GPU(duration=240)
24
- def process_image(image, prompt, steps, use_lora, use_controlnet, use_depth, use_hed, use_ip, lora_weight, negative_image, neg_prompt, true_gs, guidance, cfg):
25
  from src.flux.xflux_pipeline import XFluxPipeline
26
  def run_xflux_pipeline(
27
  prompt, image, repo_id, name, device,
@@ -129,7 +129,7 @@ def process_image(image, prompt, steps, use_lora, use_controlnet, use_depth, use
129
  height=1024,
130
  timestep_to_start_cfg=cfg,
131
  num_steps=steps,
132
- num_images_per_prompt=2,
133
  use_lora=use_lora,
134
  true_gs=true_gs,
135
  use_ip=use_ip,
@@ -204,6 +204,7 @@ with gr.Blocks(css=custom_css) as demo:
204
  use_lora = gr.Checkbox(label="Use LORA", value=True)
205
  lora_weight = gr.Slider(step=0.1, minimum=0, maximum=1, value=0.7, label="Lora Weight")
206
 
 
207
  true_gs = gr.Slider(step=0.1, minimum=0, maximum=10, value=3.5, label="TrueGs")
208
  guidance = gr.Slider(minimum=1, maximum=10, value=4, label="Guidance")
209
  cfg = gr.Slider(minimum=1, maximum=10, value=1, label="CFG")
@@ -214,7 +215,7 @@ with gr.Blocks(css=custom_css) as demo:
214
  with gr.Column(scale=2, elem_classes="app"):
215
  output = gr.Gallery(label="Galery output", elem_classes="galery")
216
 
217
- submit_btn.click(process_image, inputs=[input_image, prompt, steps, use_lora, controlnet, use_depth, use_hed, use_ip, lora_weight, negative_image, neg_prompt, true_gs, guidance, cfg], outputs=output)
218
 
219
  if __name__ == '__main__':
220
  demo.launch(share=True, debug=True)
 
21
  print("downloaded!")
22
 
23
  @spaces.GPU(duration=240)
24
+ def process_image(number_of_images, image, prompt, steps, use_lora, use_controlnet, use_depth, use_hed, use_ip, lora_weight, negative_image, neg_prompt, true_gs, guidance, cfg):
25
  from src.flux.xflux_pipeline import XFluxPipeline
26
  def run_xflux_pipeline(
27
  prompt, image, repo_id, name, device,
 
129
  height=1024,
130
  timestep_to_start_cfg=cfg,
131
  num_steps=steps,
132
+ num_images_per_prompt=number_of_images,
133
  use_lora=use_lora,
134
  true_gs=true_gs,
135
  use_ip=use_ip,
 
204
  use_lora = gr.Checkbox(label="Use LORA", value=True)
205
  lora_weight = gr.Slider(step=0.1, minimum=0, maximum=1, value=0.7, label="Lora Weight")
206
 
207
+ number_of_images = gr.Slider(step=1, minimum=0, maximum=4, value=2, label="Number of Images")
208
  true_gs = gr.Slider(step=0.1, minimum=0, maximum=10, value=3.5, label="TrueGs")
209
  guidance = gr.Slider(minimum=1, maximum=10, value=4, label="Guidance")
210
  cfg = gr.Slider(minimum=1, maximum=10, value=1, label="CFG")
 
215
  with gr.Column(scale=2, elem_classes="app"):
216
  output = gr.Gallery(label="Galery output", elem_classes="galery")
217
 
218
+ submit_btn.click(process_image, inputs=[number_of_images, input_image, prompt, steps, use_lora, controlnet, use_depth, use_hed, use_ip, lora_weight, negative_image, neg_prompt, true_gs, guidance, cfg], outputs=output)
219
 
220
  if __name__ == '__main__':
221
  demo.launch(share=True, debug=True)