Commit df41bc66 authored by Stefy Lanza (nextime / spora )'s avatar Stefy Lanza (nextime / spora )

Merge experimental: Add --invert_colors flag for color inversion control

parents 13698a69 db0f50f6
...@@ -535,7 +535,14 @@ Auto mode detects NSFW content automatically. For explicit requests: ...@@ -535,7 +535,14 @@ Auto mode detects NSFW content automatically. For explicit requests:
python3 videogen --model <model> --prompt "<prompt>" --no_filter python3 videogen --model <model> --prompt "<prompt>" --no_filter
``` ```
### 5. Reproducibility ### 5. Color Inversion
Some models (particularly certain LoRA adapters) may produce inverted colors. Fix this with:
```bash
python3 videogen --model wan2_2_i2v_general_nsfw_lora --image input.png --prompt "..." --invert_colors
```
### 6. Reproducibility
Always capture and store the seed for reproducibility: Always capture and store the seed for reproducibility:
```bash ```bash
......
...@@ -10238,11 +10238,9 @@ def main(args): ...@@ -10238,11 +10238,9 @@ def main(args):
# Convert from [-1, 1] to [0, 1] # Convert from [-1, 1] to [0, 1]
frames = (frames + 1.0) / 2.0 frames = (frames + 1.0) / 2.0
# Check if colors appear inverted (mostly dark images mean inverted) # Check if colors should be inverted (user-specified via --invert_colors)
# Inverted images have mean > 0.5 when they should be < 0.5 if args.invert_colors:
mean_val = np.mean(frames) print(f" 🎨 Inverting colors as requested (--invert_colors)...")
if mean_val > 0.7: # Likely inverted
print(f" ⚠️ Detected inverted colors (mean={mean_val:.2f}), correcting...")
frames = 1.0 - frames frames = 1.0 - frames
# Now convert from [0, 1] to [0, 255] # Now convert from [0, 1] to [0, 255]
...@@ -10480,6 +10478,8 @@ List TTS voices: ...@@ -10480,6 +10478,8 @@ List TTS voices:
help="Directory for output files (overrides --output path)") help="Directory for output files (overrides --output path)")
parser.add_argument("--seed", type=int, default=-1) parser.add_argument("--seed", type=int, default=-1)
parser.add_argument("--no_filter", action="store_true") parser.add_argument("--no_filter", action="store_true")
parser.add_argument("--invert_colors", action="store_true",
help="Invert video colors after generation (fixes inverted output from some models)")
parser.add_argument("--upscale", action="store_true") parser.add_argument("--upscale", action="store_true")
parser.add_argument("--upscale_factor", type=float, default=2.0) parser.add_argument("--upscale_factor", type=float, default=2.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment