Skip to content

docs(examples): add workflow_chain.py — t2i → i2i → i2v API demo - #129

Merged
ffroliva merged 3 commits into
developfrom
feature/examples-workflow-chain
May 30, 2026
Merged

ffroliva merged 3 commits into
developfrom
feature/examples-workflow-chain

Conversation

@ffroliva

Copy link
Copy Markdown
Owner

Adds examples/workflow_chain.py — a runnable, developer-facing demo of the in-process FlowApiClient t2i → i2i → i2v chain in one Flow session. Codifies the three in-process gotchas (Aspect.from_cli, download_image returns the actual path, generate_video has no project_id).

Defaults to --video-model veo-lite — omni-flash does NOT support i2v interpolation (it silently routes to T2V; gflow-cli #125, fixed in #128). The i2v phase works correctly now that #128 is on develop.

Lift of the proven chain from the gflow-cli-remotion promo harness, stripped of all OBS/Remotion/sentinel machinery (pure API). README updated.

🤖 Generated with Claude Code

ffroliva and others added 3 commits May 30, 2026 13:24
…ession

Lifts the proven 3-step in-process chain from the gflow-cli-remotion
promo harness into a clean developer-facing example. Demonstrates the
in-process FlowApiClient pattern for composing image and video surfaces:

  1. generate_image (t2i)              -> initial frame
  2. generate_image (i2i, ref=t2i)     -> end frame in same style
  3. generate_video (i2v, start=t2i,   -> 8s interpolation
                          end=i2i)

Codifies the three asymmetries every direct-API caller hits:

  - Aspect / Model / VideoModel: use `from_cli(...)`, not the bare
    constructor (the StrEnum value is the wire format, e.g.
    `IMAGE_ASPECT_RATIO_PORTRAIT`).
  - `client.download_image(image, target)` returns the actual saved
    path — `paths.correct_image_extension()` may rename post-write if
    Flow served a different format than the requested extension. The
    i2i `ref_paths` and i2v `start_image` / `end_image` must use the
    real returned path.
  - `generate_video` does NOT accept `project_id` (unlike
    `generate_image`); the transport derives project context from the
    current session.

Defaults to a minimalist stickman dawn subject so the example is
runnable end-to-end without supplying prompts. The motion prompt
anchors visual style explicitly ("Maintain exact 2D black ink line-art
style, same characters as start/end frame") — without this anchor Veo
omni-flash drifts into a 3D photoreal aesthetic regardless of the ref
frames (diagnosed via master.mp4 review of the wf-004 paid capture).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
omni-flash does not support i2v interpolation — it silently drops the
start/end frames and produces a text-only video (gflow-cli #125, fixed in
#128). The example's --video-model now defaults to veo-lite, and the help
text documents the constraint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ffroliva
ffroliva merged commit 08c5195 into develop May 30, 2026
6 checks passed
@ffroliva
ffroliva deleted the feature/examples-workflow-chain branch May 31, 2026 00:13
15990166686ll-crypto pushed a commit to 15990166686ll-crypto/gflow-cli that referenced this pull request Aug 24, 2026
…ow-chain

docs(examples): add workflow_chain.py — t2i → i2i → i2v API demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant