Upload Qwen_Qwen-Image-Edit-2509_0.py with huggingface_hub
Browse files
Qwen_Qwen-Image-Edit-2509_0.py
CHANGED
|
@@ -4,6 +4,8 @@
|
|
| 4 |
# "numpy",
|
| 5 |
# "einops",
|
| 6 |
# "pandas",
|
|
|
|
|
|
|
| 7 |
# "protobuf",
|
| 8 |
# "torch",
|
| 9 |
# "sentencepiece",
|
|
@@ -19,10 +21,12 @@
|
|
| 19 |
# ///
|
| 20 |
|
| 21 |
try:
|
|
|
|
| 22 |
from diffusers import DiffusionPipeline
|
| 23 |
from diffusers.utils import load_image
|
| 24 |
|
| 25 |
-
|
|
|
|
| 26 |
|
| 27 |
prompt = "Turn this cat into a dog"
|
| 28 |
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
|
@@ -42,10 +46,12 @@ except Exception as e:
|
|
| 42 |
with open('Qwen_Qwen-Image-Edit-2509_0.txt', 'a', encoding='utf-8') as f:
|
| 43 |
import traceback
|
| 44 |
f.write('''```CODE:
|
|
|
|
| 45 |
from diffusers import DiffusionPipeline
|
| 46 |
from diffusers.utils import load_image
|
| 47 |
|
| 48 |
-
|
|
|
|
| 49 |
|
| 50 |
prompt = "Turn this cat into a dog"
|
| 51 |
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
|
|
|
| 4 |
# "numpy",
|
| 5 |
# "einops",
|
| 6 |
# "pandas",
|
| 7 |
+
# "matplotlib",
|
| 8 |
+
# "paddleorc",
|
| 9 |
# "protobuf",
|
| 10 |
# "torch",
|
| 11 |
# "sentencepiece",
|
|
|
|
| 21 |
# ///
|
| 22 |
|
| 23 |
try:
|
| 24 |
+
import torch
|
| 25 |
from diffusers import DiffusionPipeline
|
| 26 |
from diffusers.utils import load_image
|
| 27 |
|
| 28 |
+
# switch to "mps" for apple devices
|
| 29 |
+
pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", dtype=torch.bfloat16, device_map="cuda")
|
| 30 |
|
| 31 |
prompt = "Turn this cat into a dog"
|
| 32 |
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
|
|
|
| 46 |
with open('Qwen_Qwen-Image-Edit-2509_0.txt', 'a', encoding='utf-8') as f:
|
| 47 |
import traceback
|
| 48 |
f.write('''```CODE:
|
| 49 |
+
import torch
|
| 50 |
from diffusers import DiffusionPipeline
|
| 51 |
from diffusers.utils import load_image
|
| 52 |
|
| 53 |
+
# switch to "mps" for apple devices
|
| 54 |
+
pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", dtype=torch.bfloat16, device_map="cuda")
|
| 55 |
|
| 56 |
prompt = "Turn this cat into a dog"
|
| 57 |
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|