POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/wan-2.2-t2v-fast"; const data = { "prompt": "A sophisticated Korean teacher in her early 30s, with sleek, black hair tied in a high bun and sharp, cat-like eyes, stands at the front of the room. She wears a tailored blazer and pencil skirt, exuding authority. As she writes on the chalkboard, the chalk’s texture against her fingers sends a jolt of pleasure through her. The camera lingers on her face—her composed expression cracks as her lips tremble, her eyes flutter, and unaware figures remain in the background.", "go_fast": true, "num_frames": 81, "resolution": "480p", "aspect_ratio": "16:9", "sample_shift": 12, "frames_per_second": 16 }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


seedint ( default: 1 )

Random seed for reproducibility. Use a fixed seed for consistent outputs or leave blank for randomness.


promptstr *

Prompt describes the scene. Choose vivid and clear descriptions for best results.


go_fastbool ( default: true )

Toggles speed of video creation. Set to true for quicker outputs.


num_framesint ( default: 81 )

Total frames in the video. 81 frames offer optimal quality.

min : 81,

max : 100


resolutionenum:str ( default: 480p )

Select video resolution. Choose 480p for faster renders, 720p for quality.

Allowed values:


aspect_ratioenum:str ( default: 16:9 )

Aspect ratio of the video. 16:9 is standard, 9:16 for vertical.

Allowed values:


sample_shiftfloat ( default: 12 )

Controls frame sample shift. Increase for more motion variation.

min : 1,

max : 20


frames_per_secondint ( default: 16 )

Video FPS. 16 fps is balanced; increase for smoother motion.

min : 5,

max : 24

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

What is Wan2.2?

Wan2.2 is a state-of-the-art generative AI video model by Wan-AI, designed for both text-to-video and image-to-video synthesis. Leveraging a Mixture-of-Experts architecture, Wan2.2 dynamically routes denoising tasks to specialized expert networks, delivering cinematic-quality clips without extra computational overhead. It generates HD video at 480p or 720p and supports up to 24 frames per second, running efficiently on consumer GPUs such as the NVIDIA RTX 4090. Ideal for developers, creators, and product managers, Wan2.2 outperforms many commercial alternatives in both research settings and production pipelines.

Key Features

  • Mixture-of-Experts Architecture
    Separate expert networks for different denoising stages improve quality and stability.
  • High-Definition Output
    Choose 480p for faster renders or 720p for sharper detail, both at up to 24 fps.
  • Flexible Input Modes
    Support for text-to-video prompts and image-to-video transformations with consistent styling.
  • Consumer-Grade Hardware
    Optimized for GPUs like the RTX 4090, ensuring real-time previews and batch processing.
  • Advanced Parameter Controls
    • seed: Set a fixed integer for reproducible outputs or leave blank for randomness.
    • num_frames: Configure total frames (81–100) for desired clip length.
    • frames_per_second: Balance motion smoothness (5–24 fps).
    • resolution & aspect_ratio: Switch between standard (16:9) and vertical (9:16) video layouts.
    • sample_shift: Adjust motion variation for dynamic scenes.
    • go_fast: Toggle faster video creation during prototyping.

Best Use Cases

  • Prototype Animations: Quickly visualize user journeys and product demos.
  • Marketing Content: Generate short cinematic teasers, vertical ads, and social media reels.
  • Educational Videos: Create animated explainers with precise lighting and motion control.
  • R&D and Experimentation: Benchmark generative video pipelines for academic or industrial research.
  • Creative Storyboarding: Turn text scripts or concept art into motion-rich sequences.

Prompt Tips and Output Quality

  • Be Vivid and Specific: “A futuristic spaceship flying over a neon-lit city at dawn” yields richer details.
  • Leverage Seed for A/B Testing: Fix the seed to compare different prompt variations under identical conditions.
  • Optimize Frame Rate: Use 16 fps for balanced quality; up to 24 fps for smooth camera pans and action scenes.
  • Adjust Sample Shift: Higher values introduce more motion variation—ideal for dynamic sequences.
  • Iterate with go_fast: Enable during draft iterations, then disable for final high-fidelity rendering.

FAQs

Q: How do I generate a video from text?
A: Provide a clear prompt in the text field, select resolution (480p/720p), set num_frames and frames_per_second, then run the model.

Q: Can I control the video’s aspect ratio?
A: Yes. Use the aspect_ratio parameter to choose 16:9 for landscape or 9:16 for vertical output.

Q: What hardware is required to run Wan2.2?
A: A consumer GPU like NVIDIA RTX 4090 or equivalent with 24 fps support is recommended for smooth performance.

Q: How do I reproduce the same video output?
A: Set the seed parameter to a fixed integer. Leaving it blank generates new random variations each run.