Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
import random
|
|
@@ -13,17 +14,21 @@ from huggingface_hub import hf_hub_download
|
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
-
|
| 17 |
pipe = QwenImagePipeline.from_pretrained(
|
| 18 |
torch_dtype=torch.bfloat16,
|
| 19 |
device="cuda",
|
| 20 |
model_configs=[
|
| 21 |
-
ModelConfig(model_id="Qwen/Qwen-Image-Edit-2509",
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
],
|
| 25 |
tokenizer_config=None,
|
| 26 |
-
processor_config=ModelConfig(model_id="Qwen/Qwen-Image-Edit",
|
|
|
|
| 27 |
)
|
| 28 |
|
| 29 |
|
|
@@ -126,7 +131,6 @@ _HEADER_ = '''
|
|
| 126 |
|
| 127 |
|
| 128 |
<p style="font-size: 1rem; margin-bottom: 1.5rem;">Paper: <a href='https://openreview.net/forum?id=Cgb7JpOA5Q&referrer=%5Bthe%20profile%20of%20Shiwen%20Zhang%5D(%2Fprofile%3Fid%3D~Shiwen_Zhang1)' target='_blank'>QwenStyle: Content-Preserving Style Transfer with Qwen-Image-Edit</a> | Codes: <a href='https://github.com/witcherofresearch/Qwen-Image-Style-Transfer' target='_blank'>GitHub</a></p>
|
| 129 |
-
<p style="font-size: 1rem; margin-bottom: 1.5rem;">If you encounter an Error with this demo, the most possible reason is ZeroGPU out-of-memory and the solution is to decrease the Min Edge of the generated image from 1024 to a lower value. This is because ZeroGPU has a memory limit of 70GB, while all the examples are tested with 80GB H100 GPUs. </p>
|
| 130 |
'''
|
| 131 |
|
| 132 |
with gr.Blocks() as demo:
|
|
|
|
| 1 |
+
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
import random
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
|
|
|
|
| 17 |
pipe = QwenImagePipeline.from_pretrained(
|
| 18 |
torch_dtype=torch.bfloat16,
|
| 19 |
device="cuda",
|
| 20 |
model_configs=[
|
| 21 |
+
ModelConfig(model_id="Qwen/Qwen-Image-Edit-2509",
|
| 22 |
+
download_source='huggingface',
|
| 23 |
+
origin_file_pattern="transformer/diffusion_pytorch_model*.safetensors"),
|
| 24 |
+
ModelConfig(model_id="Qwen/Qwen-Image-Edit-2509",
|
| 25 |
+
download_source='huggingface',origin_file_pattern="text_encoder/model*.safetensors"),
|
| 26 |
+
ModelConfig(model_id="Qwen/Qwen-Image-Edit-2509",
|
| 27 |
+
download_source='huggingface',origin_file_pattern="vae/diffusion_pytorch_model.safetensors"),
|
| 28 |
],
|
| 29 |
tokenizer_config=None,
|
| 30 |
+
processor_config=ModelConfig(model_id="Qwen/Qwen-Image-Edit-2509",
|
| 31 |
+
download_source='huggingface',origin_file_pattern="processor/"),
|
| 32 |
)
|
| 33 |
|
| 34 |
|
|
|
|
| 131 |
|
| 132 |
|
| 133 |
<p style="font-size: 1rem; margin-bottom: 1.5rem;">Paper: <a href='https://openreview.net/forum?id=Cgb7JpOA5Q&referrer=%5Bthe%20profile%20of%20Shiwen%20Zhang%5D(%2Fprofile%3Fid%3D~Shiwen_Zhang1)' target='_blank'>QwenStyle: Content-Preserving Style Transfer with Qwen-Image-Edit</a> | Codes: <a href='https://github.com/witcherofresearch/Qwen-Image-Style-Transfer' target='_blank'>GitHub</a></p>
|
|
|
|
| 134 |
'''
|
| 135 |
|
| 136 |
with gr.Blocks() as demo:
|