Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
27ccb0f
1
Parent(s):
da068d4
modified: .gitignore
Browse files- .gitignore +1 -0
- app.py +15 -2
- src/flux/__pycache__/__init__.cpython-310.pyc +0 -0
- src/flux/__pycache__/_version.cpython-310.pyc +0 -0
- src/flux/__pycache__/math.cpython-310.pyc +0 -0
- src/flux/__pycache__/model.cpython-310.pyc +0 -0
- src/flux/__pycache__/sampling.cpython-310.pyc +0 -0
- src/flux/__pycache__/util.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/autoencoder.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/conditioner.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/layers.cpython-310.pyc +0 -0
.gitignore
CHANGED
@@ -3,3 +3,4 @@ __pycache__/
|
|
3 |
*.pyc
|
4 |
heatmap/
|
5 |
src/gradio_utils/gradio_outputs/
|
|
|
|
3 |
*.pyc
|
4 |
heatmap/
|
5 |
src/gradio_utils/gradio_outputs/
|
6 |
+
src/gradio_utils/gradio_prompts/
|
app.py
CHANGED
@@ -519,6 +519,19 @@ def on_change(init_image, changed: gr.EventData):
|
|
519 |
|
520 |
|
521 |
def create_demo(model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
is_schnell = model_name == "flux-schnell"
|
523 |
|
524 |
# Pre-defined examples
|
@@ -528,9 +541,10 @@ def create_demo(model_name: str, device: str = "cuda" if torch.cuda.is_available
|
|
528 |
|
529 |
with gr.Blocks() as demo:
|
530 |
gr.Markdown(f"# Multi-turn Consistent Image Editing (FLUX.1-dev)")
|
531 |
-
|
532 |
with gr.Row():
|
533 |
with gr.Column():
|
|
|
534 |
source_prompt = gr.Textbox(label="Source Prompt", value="(Optional) Describe the content of the uploaded image.")
|
535 |
target_prompt = gr.Textbox(label="Target Prompt", value="(Required) Describe the desired content of the edited image.")
|
536 |
with gr.Row():
|
@@ -555,7 +569,6 @@ def create_demo(model_name: str, device: str = "cuda" if torch.cuda.is_available
|
|
555 |
attn_guidance_start_block = gr.Slider(0, 18, 11, step=1, label="Top activated attn-maps", interactive=not is_schnell)
|
556 |
inject_step = gr.Slider(0, 15, 1, step=1, label="Number of inject steps")
|
557 |
output_image = gr.Image(label="Generated/Edited Image")
|
558 |
-
reset_btn = gr.Button("Reset")
|
559 |
example_image = gr.Image(label="example Image", visible=False, width=200)
|
560 |
|
561 |
gallery.select(on_select, gallery, [init_image, source_prompt])
|
|
|
519 |
|
520 |
|
521 |
def create_demo(model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu"):
|
522 |
+
|
523 |
+
description = r"""
|
524 |
+
<h3>Tips 🔔:</h3>
|
525 |
+
<ol>
|
526 |
+
<li>The app starts with default settings. To begin: <strong>(1) Click Reset Button.</strong> (2)Try the example image (at the bottom of the page) / Upload your own / Generate one with a target prompt.</li>
|
527 |
+
<li> Adaptive Attention (attn_guidance): The option<i> Top activated attn-maps</i> is effective only when this editing technique is selected. </li>
|
528 |
+
<li> If you like this project, please ⭐ us on <a href='https://github.com/ZhouZJ-DL/Multi-turn_Consistent_Image_Editing' target='_blank'>GitHub</a> or cite our <a href='https://arxiv.org/abs/2505.04320' target='_blank'>paper</a>. Thanks for your support! </li>
|
529 |
+
</ol>
|
530 |
+
"""
|
531 |
+
css = '''
|
532 |
+
.gradio-container {width: 85% !important}
|
533 |
+
'''
|
534 |
+
|
535 |
is_schnell = model_name == "flux-schnell"
|
536 |
|
537 |
# Pre-defined examples
|
|
|
541 |
|
542 |
with gr.Blocks() as demo:
|
543 |
gr.Markdown(f"# Multi-turn Consistent Image Editing (FLUX.1-dev)")
|
544 |
+
gr.Markdown(description)
|
545 |
with gr.Row():
|
546 |
with gr.Column():
|
547 |
+
reset_btn = gr.Button("Reset")
|
548 |
source_prompt = gr.Textbox(label="Source Prompt", value="(Optional) Describe the content of the uploaded image.")
|
549 |
target_prompt = gr.Textbox(label="Target Prompt", value="(Required) Describe the desired content of the edited image.")
|
550 |
with gr.Row():
|
|
|
569 |
attn_guidance_start_block = gr.Slider(0, 18, 11, step=1, label="Top activated attn-maps", interactive=not is_schnell)
|
570 |
inject_step = gr.Slider(0, 15, 1, step=1, label="Number of inject steps")
|
571 |
output_image = gr.Image(label="Generated/Edited Image")
|
|
|
572 |
example_image = gr.Image(label="example Image", visible=False, width=200)
|
573 |
|
574 |
gallery.select(on_select, gallery, [init_image, source_prompt])
|
src/flux/__pycache__/__init__.cpython-310.pyc
CHANGED
Binary files a/src/flux/__pycache__/__init__.cpython-310.pyc and b/src/flux/__pycache__/__init__.cpython-310.pyc differ
|
|
src/flux/__pycache__/_version.cpython-310.pyc
CHANGED
Binary files a/src/flux/__pycache__/_version.cpython-310.pyc and b/src/flux/__pycache__/_version.cpython-310.pyc differ
|
|
src/flux/__pycache__/math.cpython-310.pyc
CHANGED
Binary files a/src/flux/__pycache__/math.cpython-310.pyc and b/src/flux/__pycache__/math.cpython-310.pyc differ
|
|
src/flux/__pycache__/model.cpython-310.pyc
CHANGED
Binary files a/src/flux/__pycache__/model.cpython-310.pyc and b/src/flux/__pycache__/model.cpython-310.pyc differ
|
|
src/flux/__pycache__/sampling.cpython-310.pyc
CHANGED
Binary files a/src/flux/__pycache__/sampling.cpython-310.pyc and b/src/flux/__pycache__/sampling.cpython-310.pyc differ
|
|
src/flux/__pycache__/util.cpython-310.pyc
CHANGED
Binary files a/src/flux/__pycache__/util.cpython-310.pyc and b/src/flux/__pycache__/util.cpython-310.pyc differ
|
|
src/flux/modules/__pycache__/autoencoder.cpython-310.pyc
CHANGED
Binary files a/src/flux/modules/__pycache__/autoencoder.cpython-310.pyc and b/src/flux/modules/__pycache__/autoencoder.cpython-310.pyc differ
|
|
src/flux/modules/__pycache__/conditioner.cpython-310.pyc
CHANGED
Binary files a/src/flux/modules/__pycache__/conditioner.cpython-310.pyc and b/src/flux/modules/__pycache__/conditioner.cpython-310.pyc differ
|
|
src/flux/modules/__pycache__/layers.cpython-310.pyc
CHANGED
Binary files a/src/flux/modules/__pycache__/layers.cpython-310.pyc and b/src/flux/modules/__pycache__/layers.cpython-310.pyc differ
|
|