Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,10 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 15 |
|
| 16 |
# Load the model pipeline
|
| 17 |
pipe = QwenImageEditPipeline.from_pretrained("Qwen/Qwen-Image-Edit", torch_dtype=dtype).to(device)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# --- UI Constants and Helpers ---
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
|
@@ -73,7 +77,7 @@ css = """
|
|
| 73 |
with gr.Blocks(css=css) as demo:
|
| 74 |
with gr.Column(elem_id="col-container"):
|
| 75 |
gr.HTML('<img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/qwen_image_logo.png" alt="Qwen-Image Logo" width="400" style="display: block; margin: 0 auto;">')
|
| 76 |
-
gr.HTML('<h1 style="text-align: center;margin-left: 80px;color: #5b47d1;font-style: italic;">Edit</h1>', elem_id="edit_text")
|
| 77 |
gr.Markdown("[Learn more](https://github.com/QwenLM/Qwen-Image) about the Qwen-Image series. Try on [Qwen Chat](https://chat.qwen.ai/), or [download model](https://huggingface.co/Qwen/Qwen-Image-Edit) to run locally with ComfyUI or diffusers.")
|
| 78 |
with gr.Row():
|
| 79 |
with gr.Column():
|
|
@@ -115,7 +119,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 115 |
minimum=1,
|
| 116 |
maximum=50,
|
| 117 |
step=1,
|
| 118 |
-
value=
|
| 119 |
)
|
| 120 |
|
| 121 |
# gr.Examples(examples=examples, inputs=[prompt], outputs=[result, seed], fn=infer, cache_examples=False)
|
|
|
|
| 15 |
|
| 16 |
# Load the model pipeline
|
| 17 |
pipe = QwenImageEditPipeline.from_pretrained("Qwen/Qwen-Image-Edit", torch_dtype=dtype).to(device)
|
| 18 |
+
pipe.load_lora_weights(
|
| 19 |
+
"lightx2v/Qwen-Image-Lightning", weight_name="Qwen-Image-Lightning-8steps-V1.1.safetensors"
|
| 20 |
+
)
|
| 21 |
+
pipe.fuse_lora()
|
| 22 |
|
| 23 |
# --- UI Constants and Helpers ---
|
| 24 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
| 77 |
with gr.Blocks(css=css) as demo:
|
| 78 |
with gr.Column(elem_id="col-container"):
|
| 79 |
gr.HTML('<img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/qwen_image_logo.png" alt="Qwen-Image Logo" width="400" style="display: block; margin: 0 auto;">')
|
| 80 |
+
gr.HTML('<h1 style="text-align: center;margin-left: 80px;color: #5b47d1;font-style: italic;">Edit Fast</h1>', elem_id="edit_text")
|
| 81 |
gr.Markdown("[Learn more](https://github.com/QwenLM/Qwen-Image) about the Qwen-Image series. Try on [Qwen Chat](https://chat.qwen.ai/), or [download model](https://huggingface.co/Qwen/Qwen-Image-Edit) to run locally with ComfyUI or diffusers.")
|
| 82 |
with gr.Row():
|
| 83 |
with gr.Column():
|
|
|
|
| 119 |
minimum=1,
|
| 120 |
maximum=50,
|
| 121 |
step=1,
|
| 122 |
+
value=8,
|
| 123 |
)
|
| 124 |
|
| 125 |
# gr.Examples(examples=examples, inputs=[prompt], outputs=[result, seed], fn=infer, cache_examples=False)
|