Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
8f1825b
1
Parent(s):
be4c862
modified: app.py
Browse files- app.py +3 -2
- src/flux/__pycache__/__init__.cpython-310.pyc +0 -0
- src/flux/__pycache__/__init__.cpython-312.pyc +0 -0
- src/flux/__pycache__/_version.cpython-310.pyc +0 -0
- src/flux/__pycache__/_version.cpython-312.pyc +0 -0
- src/flux/__pycache__/math.cpython-310.pyc +0 -0
- src/flux/__pycache__/math.cpython-312.pyc +0 -0
- src/flux/__pycache__/model.cpython-310.pyc +0 -0
- src/flux/__pycache__/model.cpython-312.pyc +0 -0
- src/flux/__pycache__/sampling.cpython-310.pyc +0 -0
- src/flux/__pycache__/sampling.cpython-312.pyc +0 -0
- src/flux/__pycache__/util.cpython-310.pyc +0 -0
- src/flux/__pycache__/util.cpython-312.pyc +0 -0
- src/flux/modules/__pycache__/autoencoder.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/autoencoder.cpython-312.pyc +0 -0
- src/flux/modules/__pycache__/conditioner.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/conditioner.cpython-312.pyc +0 -0
- src/flux/modules/__pycache__/layers.cpython-310.pyc +0 -0
- src/flux/modules/__pycache__/layers.cpython-312.pyc +0 -0
app.py
CHANGED
|
@@ -245,7 +245,7 @@ class FluxEditor:
|
|
| 245 |
return img, history_gallery
|
| 246 |
|
| 247 |
|
| 248 |
-
@spaces.GPU(duration=
|
| 249 |
@torch.inference_mode()
|
| 250 |
def edit(self, init_image, source_prompt, target_prompt, editing_strategy, denoise_strategy, num_steps, guidance, attn_guidance_start_block, inject_step, init_image_2=None):
|
| 251 |
|
|
@@ -469,6 +469,7 @@ def on_change(init_image, changed: gr.EventData):
|
|
| 469 |
img_path = list(changed.target.temp_files)
|
| 470 |
return gr.Gallery(value=[(img_path[0], "")], label="History Image", interactive=True, columns=3), img_path[0]
|
| 471 |
|
|
|
|
| 472 |
def create_demo(model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu", offload: bool = False):
|
| 473 |
editor = FluxEditor(args)
|
| 474 |
is_schnell = model_name == "flux-schnell"
|
|
@@ -553,4 +554,4 @@ if __name__ == "__main__":
|
|
| 553 |
|
| 554 |
demo = create_demo(args.name, args.device, args.offload)
|
| 555 |
#demo.launch(server_name='0.0.0.0', share=args.share, server_port=args.port)
|
| 556 |
-
demo.launch(
|
|
|
|
| 245 |
return img, history_gallery
|
| 246 |
|
| 247 |
|
| 248 |
+
@spaces.GPU(duration=200)
|
| 249 |
@torch.inference_mode()
|
| 250 |
def edit(self, init_image, source_prompt, target_prompt, editing_strategy, denoise_strategy, num_steps, guidance, attn_guidance_start_block, inject_step, init_image_2=None):
|
| 251 |
|
|
|
|
| 469 |
img_path = list(changed.target.temp_files)
|
| 470 |
return gr.Gallery(value=[(img_path[0], "")], label="History Image", interactive=True, columns=3), img_path[0]
|
| 471 |
|
| 472 |
+
|
| 473 |
def create_demo(model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu", offload: bool = False):
|
| 474 |
editor = FluxEditor(args)
|
| 475 |
is_schnell = model_name == "flux-schnell"
|
|
|
|
| 554 |
|
| 555 |
demo = create_demo(args.name, args.device, args.offload)
|
| 556 |
#demo.launch(server_name='0.0.0.0', share=args.share, server_port=args.port)
|
| 557 |
+
demo.launch(debug=True)
|
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__/__init__.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/__init__.cpython-312.pyc and b/src/flux/__pycache__/__init__.cpython-312.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__/_version.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/_version.cpython-312.pyc and b/src/flux/__pycache__/_version.cpython-312.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__/math.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/math.cpython-312.pyc and b/src/flux/__pycache__/math.cpython-312.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__/model.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/model.cpython-312.pyc and b/src/flux/__pycache__/model.cpython-312.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__/sampling.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/sampling.cpython-312.pyc and b/src/flux/__pycache__/sampling.cpython-312.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/__pycache__/util.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/__pycache__/util.cpython-312.pyc and b/src/flux/__pycache__/util.cpython-312.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__/autoencoder.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/modules/__pycache__/autoencoder.cpython-312.pyc and b/src/flux/modules/__pycache__/autoencoder.cpython-312.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__/conditioner.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/modules/__pycache__/conditioner.cpython-312.pyc and b/src/flux/modules/__pycache__/conditioner.cpython-312.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
|
|
|
src/flux/modules/__pycache__/layers.cpython-312.pyc
CHANGED
|
Binary files a/src/flux/modules/__pycache__/layers.cpython-312.pyc and b/src/flux/modules/__pycache__/layers.cpython-312.pyc differ
|
|
|