Generate Video (Popcraft)
popcraft_generate_videoSTOP FIRST if the ask is a UGC-style ad, a creator or product ad, a TikTok/Reels/Shorts vertical ad, or any other multi-step branded production: call popcraft_get_workflow_instructions and follow the matching workflow instead of calling this tool directly — it owns the storyboard, reference discipline, cost preview and QA that a one-shot prompt misses. Everything else (a plain clip, animating one image, a single reference-driven shot) belongs here — call it directly, no workflow needed — EXCEPT when the target model advertises prompt_guide_workflow in popcraft_models_explore (Hailuo 3 / minimax-h3 → "h3-prompting"): for any directed job on such a model (references, dialogue or singing, timed shot cuts, first/last-frame, or an "expand/optimize my prompt" ask) load that workflow first and write the prompt in its structured format. Generate video with Popcraft — Seedance 2.0, Veo, Kling and more — from a text prompt, optionally driven by reference images/video/audio. Defaults: aspect_ratio "9:16", duration 5s (max 60), count 1 (must be 1, 2, or 4 — the Popcraft pricing tiers), resolution model-default. Pass medias with role start_image/end_image for a first-last-frame video, role image for reference-to-video (style/subject), role video to extend/continue an existing clip (only some models support video-to-video — check popcraft_models_explore capabilities first), or role audio (mp3/wav) to drive the video with a soundtrack or spoken line — dialogue for lip-sync, music the motion should follow (audio-input models only, e.g. the Seedance 2.0 family; must be paired with at least one image/video reference, and mind audio_input duration limits). Omit medias for pure text-to-video. When sending SEVERAL references, bind roles inside the prompt with the model's native tokens from popcraft_models_explore reference_prompt_tokens — e.g. Seedance family "Image 1"/"Video 1"/"Audio 1", Hailuo 3 (minimax-h3) <Picture 1>/<Video 1>/<Audio 1> — numbered per-type by position in medias (first image = 1, first video = 1; types count independently). Without tokens the model guesses which reference does what; with one obvious reference they're optional. References are validated against the model before charging (count, media type, size, format) — check popcraft_models_explore reference_limits/video_input/audio_input first to avoid a rejected call. IMPORTANT when attaching more than one reference video (or more than one reference audio): the model caps their COMBINED duration, not just each file — video_input.maxTotalDurationSec / audio_input.maxTotalDurationSec (Seedance 2.0 family = 15s each). Video and audio have SEPARATE budgets and are never summed together. Two 9s clips each pass the per-clip check but their 18s total is rejected upstream AFTER submitting, so add the durations up yourself and trim or drop a clip first. How strictly a duration cap is enforced is PER MODEL — read durationToleranceSec on the envelope. Where it is positive (0.18s on the Seedance family) the caps are nominal: against a 15s cap, media or a total measuring up to 15.18s is ACCEPTED, so never trim or reject a file for landing a fraction over. Where it is 0 (Hailuo 3 / minimax-h3) the window is EXACT to the millisecond at both ends — a 15047 ms audio file is refused against a [2000, 15000] ms window — so trim to land ~0.1s inside it. Set get_cost:true to preview the exact credit cost WITHOUT submitting — video is the most expensive media type, so always preview cost first unless the user has already confirmed. Seedance 2.0 family only: reference media is put through Popcraft's real-person (face) verification before generating — automatic, but a reference's FIRST use can add a few seconds or return a retry-in-5s result, and a reference that fails verification (typically a recognizable public figure) is rejected before any charge; when that happens tell the user and either switch the reference or pick a non-Seedance model. If the user's image clearly shows a real person and they choose (or you recommend) Seedance 2.0, mention this verification step up front. Model routing when the user says "Auto" or names no model: seedance-2-0 for identity/consistency-critical work (animating a poster/face/text, reference-driven motion); otherwise pick via popcraft_models_explore (type:"video"). If the user asks to animate an image WITHOUT a prompt, write the motion prompt yourself from the image content (motion-poster style: keep composition, faces and text stable and sharp; add atmospheric motion — slow push-in, drifting particles, wind in hair/cloth, subtle breathing and blinks). Local files attached in chat cannot be read by this remote server — use popcraft_media_upload_widget (or popcraft_media_upload) instead of asking for attachments. If a result carries recovery_tool, call that tool immediately; do not explain or ask first. On success, an interactive result card is shown to the user and refreshes itself automatically until the job finishes — do NOT poll or re-check status in a loop. Call popcraft_job_display at most once, and only if this client did not render a result card or the user asks about the job again later. The result includes project — the Popcraft project the output was filed into; when the user did not pass project_id/project_name, mention it briefly (e.g. "saved to ") so they know where it landed. Never tell the user how long the job will take or quote any estimate of generation time — the result card shows progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of video variants: 1, 2, or 4 (Popcraft pricing tiers) — default 1 | |
| draft | No | Seedance 2.5 only. Renders a fast 480p preview (~4× faster, billed at the 480p rate). The result carries a draft id valid 7 days; call popcraft_upgrade_video with the generation id to render the SAME clip at 1080p (billed at the 1080p rate). Rejects `resolution`; one clip only (`count` must be 1). Cheaper than direct 1080p whenever you’d reject more than ~1 in 5 first tries. | |
| model | Yes | Popcraft model id, e.g. "seedance-2-0", "veo-3", "kling-2-5" — list via popcraft_models_explore (type:"video") | |
| medias | No | Reference media as GCS URLs from popcraft_media_import_url or prior results. role:"start_image"/"end_image" together = first-last-frame video; role:"image" = reference-to-video (style/subject); role:"video" = extend/continue an existing clip; role:"audio" = mp3/wav that drives the video (lip-sync dialogue / music sync; audio-input models only, pair with an image or video reference). All model-dependent — check popcraft_models_explore capabilities (reference_limits, video_input, audio_input) first | |
| prompt | No | Text prompt describing the video to generate | |
| duration | No | Clip length in seconds, 1-60 — default 5 | |
| get_cost | No | true = return the exact credit cost WITHOUT submitting; video is the most expensive media type, so preview cost before submitting unless the user already confirmed | |
| project_id | No | File the result into this Popcraft project (id from popcraft_projects). Omit to use the user's current/last-used project (or a default). Errors if you don't own it. | |
| resolution | No | One of the model's own resolutions from popcraft_models_explore, e.g. "720p", "1080p" ("1080"/"4k"-style spellings are mapped; anything the model does not list is rejected before charging) — omit for the model default | |
| with_audio | No | The website's "Audio" toggle, for models that generate sound (e.g. the Seedance 2.0/2.5 family) — omit for the model default (sound on). false = silent output: use it when the user will lay their own track on afterwards, or when a role:"audio" song reference should only drive lip-sync/motion timing — a generated soundtrack that reproduces a copyrighted song is rejected by the provider's copyright filter, a silent render is not | |
| task_intent | No | How the prompt uses a role:"video" reference — ALWAYS set this when medias includes a video on a model whose capabilities declare video_task_constraint_warning (Seedance 2.5 family): "extend" = generate NEW footage continuing the referenced clip before/after it without altering it; "edit" = MODIFY the referenced clip (replace/remove/add content or people, redraw a region, change its audio); "generation" = the video is only a style/motion/subject reference for a brand-new video. These models classify the request server-side and REJECT a concrete aspect_ratio on edit/extend tasks (edit also requires output duration = input length), failing asynchronously AFTER the queue wait — declaring the intent lets Popcraft adjust aspect_ratio/duration up front (edit bills by the input clip length). If omitted with a video reference, Popcraft falls back to classifying the prompt with an LLM (~1s) and coerces automatically; an explicit value skips that and is authoritative | |
| aspect_ratio | No | e.g. "9:16", "16:9", "1:1" — default "9:16" | |
| project_name | No | File the result into the project with this title, creating it if it doesn't exist. Ignored when project_id is set. |