Julian Bilcke
commited on
Commit
·
8e996d9
1
Parent(s):
9c2bf6d
up
Browse files
engine.py
CHANGED
|
@@ -50,8 +50,15 @@ class MatrixGameEngine:
|
|
| 50 |
args: Optional parsed command line arguments for model configuration
|
| 51 |
"""
|
| 52 |
# Set default parameters if args not provided
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
self.fps = getattr(args, 'fps', 16)
|
| 56 |
self.inference_steps = getattr(args, 'inference_steps', 20)
|
| 57 |
self.guidance_scale = getattr(args, 'guidance_scale', 6.0)
|
|
|
|
| 50 |
args: Optional parsed command line arguments for model configuration
|
| 51 |
"""
|
| 52 |
# Set default parameters if args not provided
|
| 53 |
+
# Ensure frame dimensions are compatible with VAE downsampling (8x) and patch size [1,2,2]
|
| 54 |
+
# Dimensions must be divisible by vae_scale_factor * patch_size = 8 * 2 = 16
|
| 55 |
+
default_width = getattr(args, 'frame_width', 640)
|
| 56 |
+
default_height = getattr(args, 'frame_height', 368) # Changed from 360 to 368 (368/16=23)
|
| 57 |
+
|
| 58 |
+
# Ensure compatibility with VAE and patch size
|
| 59 |
+
vae_patch_factor = 16 # vae_scale_factor (8) * patch_size (2) for both H and W
|
| 60 |
+
self.frame_width = (default_width // vae_patch_factor) * vae_patch_factor
|
| 61 |
+
self.frame_height = (default_height // vae_patch_factor) * vae_patch_factor
|
| 62 |
self.fps = getattr(args, 'fps', 16)
|
| 63 |
self.inference_steps = getattr(args, 'inference_steps', 20)
|
| 64 |
self.guidance_scale = getattr(args, 'guidance_scale', 6.0)
|