Skip to content

video/long-form

Long-form video production pipeline — Seedance 2.0 powered, chapter-based.

Category: video
Source: workflows/video/long_form.py

FieldTypeDefaultDescription
regenerateobjectWhen set, this run is a regeneration. Workflows may read direction / keep / extra_instructions to modulate prompts; the engine persists parent_run_id and parent_variant_index as run lineage columns.
storystring""
topicstring""
variantsinteger1Number of independent variant executions (1–10). When > 1, the engine runs the workflow N times with different sampling, producing N outputs.

No schema defined.

route_script_input → generate_script_branched → estimate_cost → generate_anchor_keyframes → generate_scene_backgrounds → produce_chapters → apply_scene_layers → generate_chapter_transitions → generate_title_card → concatenate_all → add_background_music → transcribe_and_subtitle → generate_long_form_thumbnail → generate_youtube_metadata → collect_long_form_output
TaskDescription
route_script_inputDetermine script generation mode based on user input.
generate_script_branchedRun the appropriate script generation path based on _script_mode.
estimate_costEstimate production cost. Stops pipeline if dry_run=True.
generate_anchor_keyframesGenerate visual anchor images for cross-chapter consistency via Seedance references.
generate_scene_backgroundsGenerate background images per act for green screen compositing.
produce_chaptersGenerate voiceover + B-roll per act, assemble into chapter videos.
apply_scene_layersApply visual layers (elements, weather, objects) to chapter videos.
generate_chapter_transitionsGenerate smooth transitions between chapters using Seedance i2v.
generate_title_cardGenerate a title card that fades into the first chapter.
concatenate_allConcatenate title card + chapters + transitions into final video with fade-out.
add_background_musicGenerate BGM and mix into video with speech-aware ducking via raw ffmpeg.
transcribe_and_subtitleTranscribe voiceover and burn subtitles onto the video.
generate_long_form_thumbnailGenerate a YouTube thumbnail for the long-form video.
generate_youtube_metadataGenerate YouTube title, description with chapter timestamps, and tags.
collect_long_form_outputCollect and format final output. Persist artifacts.

Save the YAML below as my-run.yaml, edit the values, and run with the CLI or POST it to the API. Required fields are uncommented; optional knobs are documented above the input: block — copy any line under input: and uncomment to set.

workflow: video/long-form
# Optional fields — copy any line(s) under `input:` and uncomment to set:
# story: ""
#
# topic: ""
#
input: {}

Run it locally:

Terminal window
fab-workflow --from-file my-run.yaml

Or submit over the wire — the same file is the request body:

Terminal window
curl -X POST 'https://gofabric.dev/v1/workflows/runs?name=video/long-form' \
-H 'Authorization: Bearer fab_xxx' \
-H 'content-type: application/yaml' \
--data-binary @my-run.yaml

Every workflow also accepts the universal WorkflowInput fields — variants (1–10 fan-out) and regenerate (creative-direction hints with run lineage). See Run-specs (YAML / TOML / JSON) for the full top-level shape (metadata, priority, bundle, parent, etc.).

  • Last user task collect_long_form_output has no Pydantic return type — workflow output schema is null. Declare a WorkflowOutput subclass and pass it to Flow(output=…) for a strict contract.