Skip to content

Abstract image and video generator behind RenderBackend#33

Open
farazshaikh wants to merge 1 commit intoHKUDS:mainfrom
vmonad:fs/renderabstraction
Open

Abstract image and video generator behind RenderBackend#33
farazshaikh wants to merge 1 commit intoHKUDS:mainfrom
vmonad:fs/renderabstraction

Conversation

@farazshaikh
Copy link

Summary

  • Introduce ImageGenerator and VideoGenerator Protocol classes (tools/protocols.py) that formalize the duck-typed contract all existing generators already satisfy
  • Add RenderBackend dataclass with from_config() factory (tools/render_backend.py) that handles class instantiation and rate limiter wiring from YAML config
  • Replace duplicate ~70-line init_from_config() boilerplate in both Script2VideoPipeline and Idea2VideoPipeline with a 4-line RenderBackend.from_config() call

Zero changes to any existing provider code. All 3 backends (Google, Yunwu/Doubao, Yunwu/Veo) conform to the protocols by duck typing. Existing YAML configs work unchanged.

Test plan

  • All imports verified (protocols, RenderBackend, both pipelines)
  • RenderBackend.from_config() tested with existing flat YAML configs
  • End-to-end pipeline run with Script2VideoPipeline.init_from_config()

Introduce Protocol-based contracts (ImageGenerator, VideoGenerator) and
a config-driven RenderBackend factory that replaces the duplicate ~70-line
init_from_config boilerplate in both pipelines.

Existing generators (Google, Yunwu/Doubao, Yunwu/Veo) satisfy the
protocols by duck typing with zero changes to provider code.
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