### Advanced Performance Examples Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/CLI.md Examples showcasing maximum performance with compilation and preloading, optimization for specific GPUs like RTX 2080Ti with TeaCache, and memory-efficient setups. ```bash # Maximum performance (requires high-end GPU) python wgp.py --compile --attention sage2 --profile 3 --preload 2000 # Optimized for RTX 2080Ti python wgp.py --profile 4 --attention sdpa --teacache 2.0 # Memory-efficient setup python wgp.py --fp16 --profile 4 --perc-reserved-mem-max 0.3 ``` -------------------------------- ### Server Configuration Examples Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/CLI.md Examples for setting up a network-accessible server, creating a shareable URL with a custom theme, and locking the configuration for public use. ```bash # Network accessible server python wgp.py --listen --server-port 8080 # Shareable server with custom theme python wgp.py --share --theme gradio --open-browser # Locked configuration for public use python wgp.py --lock-config --share ``` -------------------------------- ### Verify PyTorch Installation with ROCm Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/AMD-INSTALLATION.md Run this command to check if PyTorch is correctly installed with ROCm support and to get GPU details. ```cmd python -c "import torch; print('PyTorch:', torch.__version__); print('ROCm available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'No GPU')" ``` -------------------------------- ### Basic Usage Examples Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/CLI.md Demonstrates launching the tool with specific model presets, enabling compilation for high performance, or optimizing for low VRAM. ```bash # Launch with specific model and loras python wgp.py ----lora-preset mystyle.lset # High-performance setup with compilation python wgp.py --compile --attention sage2 --profile 3 # Low VRAM setup python wgp.py --profile 4 --attention sdpa ``` -------------------------------- ### Example LoRA Preset Prompt Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/LORAS.md A basic LoRA preset prompt structure. Trigger words are typically included as comments starting with '#'. ```text # Use the keyword "ohnvx" to trigger the lora A ohnvx character is driving a car through the city ``` -------------------------------- ### Example Prompt with WanGP Window Commands Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/PROMPTS.md A practical example demonstrating the usage of various WanGP window commands within a multi-line prompt. ```text [/duration=25%] A wide dawn shot of a mountain train station. Steam rolls across the platform, red lanterns sway, and the camera slowly pushes toward a violinist waiting beside a blue suitcase. [/duration=5s,/overlap=17] The violinist steps onto the train as the platform slides backward. Keep the blue suitcase visible, the lantern reflections in the glass, and a gentle handheld camera rhythm. [/new_shot,/duration=4s] A sharp cut to inside the dining car at night. The violinist now sits across from a silent chess player in a silver coat while rain lashes the window. [/duration=30%,/overlap=9] The chess player moves a knight, the train lights flicker, and the blue suitcase opens by itself, revealing a tiny glowing city. ``` -------------------------------- ### Quick Start: Initialize API and Submit Task Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/API.md Demonstrates how to initialize the WanGP API session, define generation settings, submit a task, and process progress, preview, and stream events. It also shows how to retrieve the final job result and handle potential errors. ```python from pathlib import Path from shared.api import init session = init( root=Path(r"C:\\WanGP"), cli_args=["--attention", "sdpa", "--profile", "4"], ) settings = { "model_type": "ltx2_22B_distilled", "prompt": "Cinematic shot of a neon train entering a rainy station", "resolution": "1280x704", "num_inference_steps": 8, "video_length": 97, "duration_seconds": 4, "force_fps": 24, } job = session.submit_task(settings) for event in job.events.iter(timeout=0.2): if event.kind == "progress": progress = event.data print(progress.phase, progress.progress, progress.current_step, progress.total_steps) elif event.kind == "preview": preview = event.data if preview.image is not None: preview.image.save("preview.png") elif event.kind == "stream": line = event.data print(f"[{line.stream}] {line.text}") result = job.result() if result.success: print(result.generated_files) else: for error in result.errors: print(error.message) ``` -------------------------------- ### Macro System Syntax and Example Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/PROMPTS.md Define variables and their values on a single line starting with '!'. Subsequent lines use these variables as templates. WanGP cycles through values, reusing shorter lists cyclically if variable lengths differ. ```text ! {Variable1}="valueA","valueB" : {Variable2}="valueC","valueD" This is a template using {Variable1} and {Variable2}. ``` -------------------------------- ### Install SageAttention Source: https://github.com/deepbeepmeep/wan2gp/blob/main/docs/AMD-INSTALLATION.md Install the SageAttention library, which is required for certain attention implementations. Use a version less than 2. ```cmd pip install "sageattention <2" ```