ariG23498 HF Staff commited on
Commit
49ee769
·
verified ·
1 Parent(s): 934f17d

Upload lovis93_next-scene-qwen-image-lora-2509_0.py with huggingface_hub

Browse files
lovis93_next-scene-qwen-image-lora-2509_0.py CHANGED
@@ -11,7 +11,16 @@
11
  # ///
12
 
13
  try:
14
- !pip install -U diffusers
 
 
 
 
 
 
 
 
 
15
  with open('lovis93_next-scene-qwen-image-lora-2509_0.txt', 'w', encoding='utf-8') as f:
16
  f.write('Everything was good in lovis93_next-scene-qwen-image-lora-2509_0.txt')
17
  except Exception as e:
@@ -26,7 +35,16 @@ except Exception as e:
26
  with open('lovis93_next-scene-qwen-image-lora-2509_0.txt', 'a', encoding='utf-8') as f:
27
  import traceback
28
  f.write('''```CODE:
29
- !pip install -U diffusers
 
 
 
 
 
 
 
 
 
30
  ```
31
 
32
  ERROR:
 
11
  # ///
12
 
13
  try:
14
+ from diffusers import DiffusionPipeline
15
+ from diffusers.utils import load_image
16
+
17
+ pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509")
18
+ pipe.load_lora_weights("lovis93/next-scene-qwen-image-lora-2509")
19
+
20
+ prompt = "Turn this cat into a dog"
21
+ input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
22
+
23
+ image = pipe(image=input_image, prompt=prompt).images[0]
24
  with open('lovis93_next-scene-qwen-image-lora-2509_0.txt', 'w', encoding='utf-8') as f:
25
  f.write('Everything was good in lovis93_next-scene-qwen-image-lora-2509_0.txt')
26
  except Exception as e:
 
35
  with open('lovis93_next-scene-qwen-image-lora-2509_0.txt', 'a', encoding='utf-8') as f:
36
  import traceback
37
  f.write('''```CODE:
38
+ from diffusers import DiffusionPipeline
39
+ from diffusers.utils import load_image
40
+
41
+ pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509")
42
+ pipe.load_lora_weights("lovis93/next-scene-qwen-image-lora-2509")
43
+
44
+ prompt = "Turn this cat into a dog"
45
+ input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
46
+
47
+ image = pipe(image=input_image, prompt=prompt).images[0]
48
  ```
49
 
50
  ERROR: