Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
import random
|
|
@@ -14,6 +13,8 @@ from huggingface_hub import hf_hub_download
|
|
| 14 |
|
| 15 |
|
| 16 |
|
|
|
|
|
|
|
| 17 |
pipe = QwenImagePipeline.from_pretrained(
|
| 18 |
torch_dtype=torch.bfloat16,
|
| 19 |
device="cuda",
|
|
@@ -34,8 +35,6 @@ pipe = QwenImagePipeline.from_pretrained(
|
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
speedup = hf_hub_download(repo_id="witcherderivia/Qwen-Image-Style-Transfer", filename="diffsynth_Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors")
|
| 40 |
qwenstyle= hf_hub_download(repo_id="witcherderivia/Qwen-Image-Style-Transfer", filename="diffsynth_Qwen-Image-Edit-2509-Style-Transfer-V1.safetensors")
|
| 41 |
|
|
@@ -131,6 +130,7 @@ _HEADER_ = '''
|
|
| 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:
|
|
@@ -249,4 +249,4 @@ with gr.Blocks() as demo:
|
|
| 249 |
)
|
| 250 |
|
| 251 |
if __name__ == "__main__":
|
| 252 |
-
demo.launch(server_name='0.0.0.0')
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
import random
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
+
|
| 17 |
+
|
| 18 |
pipe = QwenImagePipeline.from_pretrained(
|
| 19 |
torch_dtype=torch.bfloat16,
|
| 20 |
device="cuda",
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
|
|
|
|
|
|
|
| 38 |
speedup = hf_hub_download(repo_id="witcherderivia/Qwen-Image-Style-Transfer", filename="diffsynth_Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors")
|
| 39 |
qwenstyle= hf_hub_download(repo_id="witcherderivia/Qwen-Image-Style-Transfer", filename="diffsynth_Qwen-Image-Edit-2509-Style-Transfer-V1.safetensors")
|
| 40 |
|
|
|
|
| 130 |
|
| 131 |
|
| 132 |
<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>
|
| 133 |
+
<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>
|
| 134 |
'''
|
| 135 |
|
| 136 |
with gr.Blocks() as demo:
|
|
|
|
| 249 |
)
|
| 250 |
|
| 251 |
if __name__ == "__main__":
|
| 252 |
+
demo.launch(server_name='0.0.0.0')
|