Spaces:
Running
on
Zero
Running
on
Zero
customizable lora
Browse files
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(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,
|
@@ -131,6 +131,8 @@ def process_image(number_of_images, image, prompt, steps, use_lora, use_controln
|
|
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,
|
136 |
guidance=guidance
|
@@ -202,6 +204,8 @@ with gr.Blocks(css=custom_css) as demo:
|
|
202 |
use_depth = gr.Checkbox(label="Use depth")
|
203 |
use_hed = gr.Checkbox(label="Use hed")
|
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")
|
@@ -215,7 +219,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
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)
|
|
|
21 |
print("downloaded!")
|
22 |
|
23 |
@spaces.GPU(duration=240)
|
24 |
+
def process_image(lora_path, lora_name, 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,
|
|
|
131 |
num_steps=steps,
|
132 |
num_images_per_prompt=number_of_images,
|
133 |
use_lora=use_lora,
|
134 |
+
lora_repo_id=lora_path,
|
135 |
+
lora_name=lora_name,
|
136 |
true_gs=true_gs,
|
137 |
use_ip=use_ip,
|
138 |
guidance=guidance
|
|
|
204 |
use_depth = gr.Checkbox(label="Use depth")
|
205 |
use_hed = gr.Checkbox(label="Use hed")
|
206 |
use_lora = gr.Checkbox(label="Use LORA", value=True)
|
207 |
+
lora_path = gr.Checkbox(label="Lora Path", value="XLabs-AI/flux-lora-collection")
|
208 |
+
lora_name = gr.Checkbox(label="Lora Name", value="realism_lora.safetensors")
|
209 |
lora_weight = gr.Slider(step=0.1, minimum=0, maximum=1, value=0.7, label="Lora Weight")
|
210 |
|
211 |
number_of_images = gr.Slider(step=1, minimum=0, maximum=4, value=2, label="Number of Images")
|
|
|
219 |
with gr.Column(scale=2, elem_classes="app"):
|
220 |
output = gr.Gallery(label="Galery output", elem_classes="galery")
|
221 |
|
222 |
+
submit_btn.click(process_image, inputs=[lora_path, lora_name, 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)
|
223 |
|
224 |
if __name__ == '__main__':
|
225 |
demo.launch(share=True, debug=True)
|