Upload tlennon-ie_qwen-edit-skin_0.py with huggingface_hub
Browse files
tlennon-ie_qwen-edit-skin_0.py
CHANGED
|
@@ -22,13 +22,16 @@
|
|
| 22 |
try:
|
| 23 |
import torch
|
| 24 |
from diffusers import DiffusionPipeline
|
|
|
|
| 25 |
|
| 26 |
# switch to "mps" for apple devices
|
| 27 |
pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", dtype=torch.bfloat16, device_map="cuda")
|
| 28 |
pipe.load_lora_weights("tlennon-ie/qwen-edit-skin")
|
| 29 |
|
| 30 |
prompt = "make the subjects skin details more prominent and natural"
|
| 31 |
-
|
|
|
|
|
|
|
| 32 |
with open('tlennon-ie_qwen-edit-skin_0.txt', 'w', encoding='utf-8') as f:
|
| 33 |
f.write('Everything was good in tlennon-ie_qwen-edit-skin_0.txt')
|
| 34 |
except Exception as e:
|
|
@@ -45,13 +48,16 @@ except Exception as e:
|
|
| 45 |
f.write('''```CODE:
|
| 46 |
import torch
|
| 47 |
from diffusers import DiffusionPipeline
|
|
|
|
| 48 |
|
| 49 |
# switch to "mps" for apple devices
|
| 50 |
pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", dtype=torch.bfloat16, device_map="cuda")
|
| 51 |
pipe.load_lora_weights("tlennon-ie/qwen-edit-skin")
|
| 52 |
|
| 53 |
prompt = "make the subjects skin details more prominent and natural"
|
| 54 |
-
|
|
|
|
|
|
|
| 55 |
```
|
| 56 |
|
| 57 |
ERROR:
|
|
|
|
| 22 |
try:
|
| 23 |
import torch
|
| 24 |
from diffusers import DiffusionPipeline
|
| 25 |
+
from diffusers.utils import load_image
|
| 26 |
|
| 27 |
# switch to "mps" for apple devices
|
| 28 |
pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509", dtype=torch.bfloat16, device_map="cuda")
|
| 29 |
pipe.load_lora_weights("tlennon-ie/qwen-edit-skin")
|
| 30 |
|
| 31 |
prompt = "make the subjects skin details more prominent and natural"
|
| 32 |
+
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
| 33 |
+
|
| 34 |
+
image = pipe(image=input_image, prompt=prompt).images[0]
|
| 35 |
with open('tlennon-ie_qwen-edit-skin_0.txt', 'w', encoding='utf-8') as f:
|
| 36 |
f.write('Everything was good in tlennon-ie_qwen-edit-skin_0.txt')
|
| 37 |
except Exception as e:
|
|
|
|
| 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 |
pipe.load_lora_weights("tlennon-ie/qwen-edit-skin")
|
| 56 |
|
| 57 |
prompt = "make the subjects skin details more prominent and natural"
|
| 58 |
+
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
| 59 |
+
|
| 60 |
+
image = pipe(image=input_image, prompt=prompt).images[0]
|
| 61 |
```
|
| 62 |
|
| 63 |
ERROR:
|