import { type VideoClientParams, type VideoStats } from "../../schemas/index"; export interface VideoProgressTick { step: number; totalSteps: number; elapsedMs: number; } export interface VideoResult { requestId: string; progressStream: AsyncGenerator; outputs: Promise; stats: Promise; } /** * Generates a video using a loaded video diffusion model. * * @param params - Video request parameters (model, prompt, dimensions, frame count, fps, sampler, seed, etc.). * @returns A result object exposing `requestId` (stable identifier for this in-flight generation), `progressStream` (async iterator of `{ step, totalSteps, elapsedMs }`), `outputs` (promise of the generated video buffers, typically a single AVI file), and `stats` (promise of generation statistics). * * Supports `txt2vid` (text-to-video) and `img2vid` (image-to-video). For `img2vid`, * load the Wan pipeline with `modelConfig.clipVisionModelSrc` set to * `clip_vision_h.safetensors`. On React Native, prefer a `modelId` loaded with a * `delegate` since the bundled video diffusion models are too large for typical mobile devices. * * @example Basic txt2vid generation * ```typescript * const { outputs, stats } = video({ * modelId, * mode: "txt2vid", * prompt: "a cat surfing a wave at sunset", * width: 480, * height: 832, * video_frames: 17, // must satisfy (4*k + 1) * fps: 16, * }); * const buffers = await outputs; * fs.writeFileSync("output.avi", buffers[0]); * ``` * * @example With progress tracking * ```typescript * const { progressStream, outputs } = video({ * modelId, * mode: "txt2vid", * prompt: "a sunset over the ocean", * }); * for await (const { step, totalSteps } of progressStream) { * console.log(`${step}/${totalSteps}`); * } * const buffers = await outputs; * ``` * * @example Image-to-video (first frame + motion prompt) * ```typescript * const firstFrame = fs.readFileSync("portrait.png"); * const { outputs } = video({ * modelId, * mode: "img2vid", * prompt: "the subject slowly turns and smiles, cinematic lighting", * init_image: firstFrame, * strength: 0.85, * }); * ``` * * @example With control frames (e.g. for guided generation) * ```typescript * const frameA = fs.readFileSync("frame-a.png"); * const frameB = fs.readFileSync("frame-b.png"); * const { outputs } = video({ * modelId, * mode: "txt2vid", * prompt: "smooth transition between scenes", * control_frames: [frameA, frameB], * }); * ``` * * @example Cancellation via requestId * ```typescript * const { requestId, outputs } = video({ modelId, mode: "txt2vid", prompt: "..." }); * // ...later * await cancel(requestId); * ``` */ export declare function video(params: VideoClientParams): VideoResult; //# sourceMappingURL=video.d.ts.map