Apply camera transformations to images and videos using Qwen-Image-Edit-2509 with Multiple Angles LoRA.
pip install -r requirements.txt
python test_installation.py
Note: The optimization module is only available on HuggingFace Spaces and is not required for local processing. You may see a note about it being unavailable - this is expected and does not affect functionality.
Launch the interactive web interface:
python app.py
Then open your browser and upload an image to apply camera transformations.
python process_video.py input.mp4 --operation rotate_left_45
This creates input_processed.mp4 with the camera rotated 45° to the left.
python process_video.py video.mp4 --operation close_up --max-frames 10
# Process every 2nd frame (2x faster)
python process_video.py video.mp4 --operation rotate_left_45 --skip-frames 2
# Process every 4th frame (4x faster)
python process_video.py video.mp4 --operation zoom_out --skip-frames 4
# Process all videos in a directory
python batch_process_videos.py --dir ./videos --operation close_up
# Or create a config file
python batch_process_videos.py --create-config
# Edit batch_config.json, then run:
python batch_process_videos.py --config batch_config.json
| Operation | Description |
|---|---|
rotate_left_45 | Rotate camera 45° to the left |
rotate_right_45 | Rotate camera 45° to the right |
rotate_left_90 | Rotate camera 90° to the left |
rotate_right_90 | Rotate camera 90° to the right |
top_down | Switch to bird's eye / top-down view |
low_angle | Switch to low-angle / looking up view |
close_up | Close-up lens (zoom in close) |
medium_close_up | Medium close-up lens |
zoom_out | Zoom out / pull camera back |
You can use custom prompts in Chinese for more control:
python process_video.py input.mp4 --custom-prompt "将镜头转为斜俯视 并 拉远镜头"
Add extra context to any operation:
python process_video.py input.mp4 --operation close_up --extra-prompt "被摄体是一名女孩子"
# Faster processing (fewer inference steps)
python process_video.py input.mp4 --steps 2
# Higher quality (more inference steps)
python process_video.py input.mp4 --steps 8
# Adjust guidance scale for output control
python process_video.py input.mp4 --guidance-scale 2.0
# Specify output path
python process_video.py input.mp4 --output my_output.mp4
# Keep intermediate frames for inspection
python process_video.py input.mp4 --keep-frames
# Change working directory for temporary files
python process_video.py input.mp4 --work-dir /tmp/video_work
# Set random seed for reproducibility
python process_video.py input.mp4 --seed 42
python process_video.py \
my_video.mp4 \
--output rotated_video.mp4 \
--operation rotate_right_90 \
--extra-prompt "outdoor scene" \
--steps 4 \
--guidance-scale 1.0 \
--skip-frames 2 \
--seed 123 \
--keep-frames
--max-frames 10 to test settings before processing full videos--skip-frames 2 for 2x speed with minimal quality lossOn RTX 4080 (16GB VRAM):
--skip-frames 2: 50% faster--skip-frames 4: 75% fasterpython process_video.py --help
Key options:
--output: Output video path--operation: Camera operation to apply--custom-prompt: Custom Chinese prompt (overrides operation)--extra-prompt: Additional prompt text--seed: Random seed for reproducibility--steps: Number of inference steps (default: 4)--guidance-scale: True guidance scale (default: 1.0)--max-frames: Maximum frames to process (for testing)--skip-frames: Process every Nth frame (1=all, 2=every other, etc.)--keep-frames: Keep extracted and processed frames--work-dir: Working directory for temporary framespython batch_process_videos.py --help
Key options:
--dir: Directory containing videos--operation: Camera operation for all videos--config: JSON config file for batch processing--create-config: Generate example config fileIf you encounter CUDA out of memory errors:
--skip-frames 2 or higher--max-frames to limit frame count--steps 2--skip-frames 2 or higher--max-frames 50--steps 8--guidance-scale 1.5--skip-frames 1Make sure all dependencies are installed:
pip install -r requirements.txt
--keep-frames is specifiedNote: Audio is not preserved as this is an image processing pipeline.
This fork adds comprehensive video processing capabilities:
process_video.pybatch_process_videos.py--max-frames for quick validationOriginal Space & Base Implementation:
Models & LoRA Weights:
Video Processing Enhancement:
Apache 2.0
Made with ❤️ building on the excellent work by the Qwen Team
1 commits
Python
98.5%
Shell
1.5%
Apply camera transformations to images and videos using Qwen-Image-Edit-2509 with Multiple Angles LoRA.
pip install -r requirements.txt
python test_installation.py
Note: The optimization module is only available on HuggingFace Spaces and is not required for local processing. You may see a note about it being unavailable - this is expected and does not affect functionality.
Launch the interactive web interface:
python app.py
Then open your browser and upload an image to apply camera transformations.
python process_video.py input.mp4 --operation rotate_left_45
This creates input_processed.mp4 with the camera rotated 45° to the left.
python process_video.py video.mp4 --operation close_up --max-frames 10
# Process every 2nd frame (2x faster)
python process_video.py video.mp4 --operation rotate_left_45 --skip-frames 2
# Process every 4th frame (4x faster)
python process_video.py video.mp4 --operation zoom_out --skip-frames 4
# Process all videos in a directory
python batch_process_videos.py --dir ./videos --operation close_up
# Or create a config file
python batch_process_videos.py --create-config
# Edit batch_config.json, then run:
python batch_process_videos.py --config batch_config.json
| Operation | Description |
|---|---|
rotate_left_45 | Rotate camera 45° to the left |
rotate_right_45 | Rotate camera 45° to the right |
rotate_left_90 | Rotate camera 90° to the left |
rotate_right_90 | Rotate camera 90° to the right |
top_down | Switch to bird's eye / top-down view |
low_angle | Switch to low-angle / looking up view |
close_up | Close-up lens (zoom in close) |
medium_close_up | Medium close-up lens |
zoom_out | Zoom out / pull camera back |
You can use custom prompts in Chinese for more control:
python process_video.py input.mp4 --custom-prompt "将镜头转为斜俯视 并 拉远镜头"
Add extra context to any operation:
python process_video.py input.mp4 --operation close_up --extra-prompt "被摄体是一名女孩子"
# Faster processing (fewer inference steps)
python process_video.py input.mp4 --steps 2
# Higher quality (more inference steps)
python process_video.py input.mp4 --steps 8
# Adjust guidance scale for output control
python process_video.py input.mp4 --guidance-scale 2.0
# Specify output path
python process_video.py input.mp4 --output my_output.mp4
# Keep intermediate frames for inspection
python process_video.py input.mp4 --keep-frames
# Change working directory for temporary files
python process_video.py input.mp4 --work-dir /tmp/video_work
# Set random seed for reproducibility
python process_video.py input.mp4 --seed 42
python process_video.py \
my_video.mp4 \
--output rotated_video.mp4 \
--operation rotate_right_90 \
--extra-prompt "outdoor scene" \
--steps 4 \
--guidance-scale 1.0 \
--skip-frames 2 \
--seed 123 \
--keep-frames
--max-frames 10 to test settings before processing full videos--skip-frames 2 for 2x speed with minimal quality lossOn RTX 4080 (16GB VRAM):
--skip-frames 2: 50% faster--skip-frames 4: 75% fasterpython process_video.py --help
Key options:
--output: Output video path--operation: Camera operation to apply--custom-prompt: Custom Chinese prompt (overrides operation)--extra-prompt: Additional prompt text--seed: Random seed for reproducibility--steps: Number of inference steps (default: 4)--guidance-scale: True guidance scale (default: 1.0)--max-frames: Maximum frames to process (for testing)--skip-frames: Process every Nth frame (1=all, 2=every other, etc.)--keep-frames: Keep extracted and processed frames--work-dir: Working directory for temporary framespython batch_process_videos.py --help
Key options:
--dir: Directory containing videos--operation: Camera operation for all videos--config: JSON config file for batch processing--create-config: Generate example config fileIf you encounter CUDA out of memory errors:
--skip-frames 2 or higher--max-frames to limit frame count--steps 2--skip-frames 2 or higher--max-frames 50--steps 8--guidance-scale 1.5--skip-frames 1Make sure all dependencies are installed:
pip install -r requirements.txt
--keep-frames is specifiedNote: Audio is not preserved as this is an image processing pipeline.
This fork adds comprehensive video processing capabilities:
process_video.pybatch_process_videos.py--max-frames for quick validationOriginal Space & Base Implementation:
Models & LoRA Weights:
Video Processing Enhancement:
Apache 2.0
Made with ❤️ building on the excellent work by the Qwen Team
1 commits
Python
98.5%
Shell
1.5%