Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,13 +25,13 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 25 |
|
| 26 |
pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509",
|
| 27 |
transformer= QwenImageTransformer2DModel.from_pretrained("linoyts/Qwen-Image-Edit-Rapid-AIO",
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
|
| 32 |
pipe.load_lora_weights("autoweeb/Qwen-Image-Edit-2509-Photo-to-Anime",
|
| 33 |
-
|
| 34 |
-
|
| 35 |
pipe.set_adapters(["anime"], adapter_weights=[1.])
|
| 36 |
pipe.fuse_lora(adapter_names=["anime"], lora_scale=1.0)
|
| 37 |
pipe.unload_lora_weights()
|
|
@@ -175,7 +175,8 @@ def update_dimensions_on_upload(image):
|
|
| 175 |
return new_width, new_height
|
| 176 |
|
| 177 |
|
| 178 |
-
|
|
|
|
| 179 |
with gr.Column(elem_id="col-container"):
|
| 180 |
gr.Markdown("# 🎨 Photo to Anime", elem_id="title")
|
| 181 |
gr.Markdown(
|
|
@@ -234,4 +235,5 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
| 234 |
outputs=[width, height]
|
| 235 |
)
|
| 236 |
|
| 237 |
-
|
|
|
|
|
|
| 25 |
|
| 26 |
pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509",
|
| 27 |
transformer= QwenImageTransformer2DModel.from_pretrained("linoyts/Qwen-Image-Edit-Rapid-AIO",
|
| 28 |
+
subfolder='transformer',
|
| 29 |
+
torch_dtype=dtype,
|
| 30 |
+
device_map='cuda'),torch_dtype=dtype).to(device)
|
| 31 |
|
| 32 |
pipe.load_lora_weights("autoweeb/Qwen-Image-Edit-2509-Photo-to-Anime",
|
| 33 |
+
weight_name="Qwen-Image-Edit-2509-Photo-to-Anime_000001000.safetensors",
|
| 34 |
+
adapter_name="anime")
|
| 35 |
pipe.set_adapters(["anime"], adapter_weights=[1.])
|
| 36 |
pipe.fuse_lora(adapter_names=["anime"], lora_scale=1.0)
|
| 37 |
pipe.unload_lora_weights()
|
|
|
|
| 175 |
return new_width, new_height
|
| 176 |
|
| 177 |
|
| 178 |
+
# Removed theme=gr.themes.Soft(), css=css from gr.Blocks()
|
| 179 |
+
with gr.Blocks() as demo:
|
| 180 |
with gr.Column(elem_id="col-container"):
|
| 181 |
gr.Markdown("# 🎨 Photo to Anime", elem_id="title")
|
| 182 |
gr.Markdown(
|
|
|
|
| 235 |
outputs=[width, height]
|
| 236 |
)
|
| 237 |
|
| 238 |
+
# Passed theme and css to the launch() method
|
| 239 |
+
demo.launch(theme=gr.themes.Soft(), css=css)
|