nw.renderers#
Render strategies — pluggable, plan-producing, shot-typed.
Scope. A Strategy is the plug-in point of the shot render unit
(nw.workflow) — and, through the adapter in
nw/transforms/_adapters/render_strategy.py, of the general engine too.
That adapter wraps every registered strategy at import time, so registering
one here publishes a shot_to_render_result.fal.<name> Transform for free,
and nw.genres.Genre validates a genre’s strategy_names against
this registry. The two registries are one pipeline with two front doors, not
two pipelines — the README says the same thing under “Render strategies”.
What a Strategy cannot express is a render that is not a video shot: it is
typed to a nw.workflow.ShotPreparation in and an output.mp4 out.
So the split is by render kind, not by registry:
a new way to render a shot → register a Strategy here, and get the Transform adaptation for free;
a new render kind — audio weave, slideshow, anything whose input is not a shot — → register a
nw.transforms.Transformdirectly; that registry is the render-kind-agnostic one.
See nw#9.
A strategy knows how to turn a nw.workflow.ShotPreparation into:
A
falaw.Plan(pure data —Strategy.plan()).A final
output.mp4path, given the Plan’s executed Artifacts (Strategy.materialize()).
Strategies are registered with an xdol.Registry keyed by name. Apps
can register their own strategies (e.g. composite_lipsync, slideshow,
panel) without modifying nw.
Built-in strategies (registered at import):
lipsync— character anchor + audio → talking video (omnihuman)image_to_video— env / fresh storyboard still → animated cliptext_to_video— prompt-only short clipstill— image looped over audio (no video gen)composite_lipsync— character + environment + audio → composite-then-talk(“Thor in a bell tower playing piano, lipsynced”)
Module Attributes
Public registry — apps add strategies via |
Functions
|
Look up a strategy by name; raises if unknown. |
Return all registered strategy names (sorted). |
|
|
Register a strategy. |
Classes
|
Render-strategy contract. |
- class nw.renderers.Strategy(*args, **kwargs)[source]#
Bases:
ProtocolRender-strategy contract.
- nw.renderers.get_strategy(name)[source]#
Look up a strategy by name; raises if unknown.
- Return type:
- nw.renderers.register_strategy(name, impl)[source]#
Register a strategy. Returns
implso it can be used inline.- Return type:
- nw.renderers.strategies: Registry = <Registry nw.renderers>#
Public registry — apps add strategies via
strategies.register("name", impl).
Modules
Strategy: composite_lipsync — character + environment + audio → talking video. |
|
Strategy: image_to_video — env or fresh-storyboard still → animated clip. |
|
Strategy: lipsync — character anchor + audio → talking video. |
|
Strategy: still — image looped over audio (no fal video gen). |
|
Strategy: text_to_video — prompt-only short clip. |