LeanQuant commited on
Commit
195a01d
·
verified ·
1 Parent(s): ff195eb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -0
README.md CHANGED
@@ -49,6 +49,7 @@ This is a **DFloat11 losslessly compressed** version of the original `Qwen/Qwen-
49
  def parse_args():
50
  parser = argparse.ArgumentParser(description='Generate images using Qwen-Image model')
51
  parser.add_argument('--cpu_offload', action='store_true', help='Enable CPU offloading')
 
52
  parser.add_argument('--prompt', type=str, default='A coffee shop entrance features a chalkboard sign reading "Qwen Coffee 😊 $2 per cup," with a neon light beside it displaying "通义千问". Next to it hangs a poster showing a beautiful Chinese woman, and beneath the poster is written "π≈3.1415926-53589793-23846264-33832795-02384197".',
53
  help='Text prompt for image generation')
54
  parser.add_argument('--negative_prompt', type=str, default=' ',
@@ -82,6 +83,7 @@ This is a **DFloat11 losslessly compressed** version of the original `Qwen/Qwen-
82
  "DFloat11/Qwen-Image-DF11",
83
  device="cpu",
84
  cpu_offload=args.cpu_offload,
 
85
  bfloat16_model=transformer,
86
  )
87
 
@@ -134,6 +136,11 @@ This is a **DFloat11 losslessly compressed** version of the original `Qwen/Qwen-
134
  python qwen_image.py --cpu_offload
135
  ```
136
 
 
 
 
 
 
137
 
138
  ### 🔍 How It Works
139
 
 
49
  def parse_args():
50
  parser = argparse.ArgumentParser(description='Generate images using Qwen-Image model')
51
  parser.add_argument('--cpu_offload', action='store_true', help='Enable CPU offloading')
52
+ parser.add_argument('--no_pin_memory', action='store_true', help='Disable memory pinning')
53
  parser.add_argument('--prompt', type=str, default='A coffee shop entrance features a chalkboard sign reading "Qwen Coffee 😊 $2 per cup," with a neon light beside it displaying "通义千问". Next to it hangs a poster showing a beautiful Chinese woman, and beneath the poster is written "π≈3.1415926-53589793-23846264-33832795-02384197".',
54
  help='Text prompt for image generation')
55
  parser.add_argument('--negative_prompt', type=str, default=' ',
 
83
  "DFloat11/Qwen-Image-DF11",
84
  device="cpu",
85
  cpu_offload=args.cpu_offload,
86
+ pin_memory=not args.no_pin_memory,
87
  bfloat16_model=transformer,
88
  )
89
 
 
136
  python qwen_image.py --cpu_offload
137
  ```
138
 
139
+ If you are getting out-of-memory errors, try disabling memory-pinning:
140
+ ```bash
141
+ python qwen_image.py --cpu_offload --no_pin_memory
142
+ ```
143
+
144
 
145
  ### 🔍 How It Works
146