rahul7star commited on
Commit
b867c1e
·
verified ·
1 Parent(s): 262a0f7

Update wan2_fast.py

Browse files
Files changed (1) hide show
  1. wan2_fast.py +27 -0
wan2_fast.py CHANGED
@@ -150,8 +150,35 @@ MAX_SEED = np.iinfo(np.int32).max
150
  FIXED_FPS = 24
151
  MIN_FRAMES_MODEL = 25
152
  MAX_FRAMES_MODEL = 193
 
 
 
 
153
  IS_ORIGINAL_SPACE = os.environ.get("IS_ORIGINAL_SPACE", "True") == "True"
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  default_prompt_t2v = "cinematic footage, group of pedestrians dancing in the streets of NYC, high quality breakdance, 4K, tiktok video, intricate details, instagram feel, dynamic camera, smooth dance motion, dimly lit, stylish, beautiful faces, smiling, music video"
156
  default_negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards, watermark, text, signature"
157
 
 
150
  FIXED_FPS = 24
151
  MIN_FRAMES_MODEL = 25
152
  MAX_FRAMES_MODEL = 193
153
+
154
+
155
+
156
+
157
  IS_ORIGINAL_SPACE = os.environ.get("IS_ORIGINAL_SPACE", "True") == "True"
158
 
159
+
160
+ # Conservative limits for low-end environments
161
+ LIMITED_MAX_RESOLUTION = 640
162
+ LIMITED_MAX_DURATION = 2.0
163
+ LIMITED_MAX_STEPS = 4
164
+
165
+ # Generous limits for local or Pro spaces
166
+ ORIGINAL_SLIDER_MIN_H, ORIGINAL_SLIDER_MAX_H = 128, 1536
167
+ ORIGINAL_SLIDER_MIN_W, ORIGINAL_SLIDER_MAX_W = 128, 1536
168
+ ORIGINAL_MAX_DURATION = round(81 / 24, 1) # 3.4 seconds
169
+ ORIGINAL_MAX_STEPS = 8
170
+
171
+ if IS_ORIGINAL_SPACE:
172
+ SLIDER_MIN_H, SLIDER_MAX_H = 128, LIMITED_MAX_RESOLUTION
173
+ SLIDER_MIN_W, SLIDER_MAX_W = 128, LIMITED_MAX_RESOLUTION
174
+ MAX_DURATION = LIMITED_MAX_DURATION
175
+ MAX_STEPS = LIMITED_MAX_STEPS
176
+ else:
177
+ SLIDER_MIN_H, SLIDER_MAX_H = ORIGINAL_SLIDER_MIN_H, ORIGINAL_SLIDER_MAX_H
178
+ SLIDER_MIN_W, SLIDER_MAX_W = ORIGINAL_SLIDER_MIN_W, ORIGINAL_SLIDER_MAX_W
179
+ MAX_DURATION = ORIGINAL_MAX_DURATION
180
+ MAX_STEPS = ORIGINAL_MAX_STEPS
181
+
182
  default_prompt_t2v = "cinematic footage, group of pedestrians dancing in the streets of NYC, high quality breakdance, 4K, tiktok video, intricate details, instagram feel, dynamic camera, smooth dance motion, dimly lit, stylish, beautiful faces, smiling, music video"
183
  default_negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards, watermark, text, signature"
184