Abstract image and video generator behind RenderBackend#33
Open
farazshaikh wants to merge 1 commit intoHKUDS:mainfrom
Open
Abstract image and video generator behind RenderBackend#33farazshaikh wants to merge 1 commit intoHKUDS:mainfrom
farazshaikh wants to merge 1 commit intoHKUDS:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ImageGeneratorandVideoGeneratorProtocol classes (tools/protocols.py) that formalize the duck-typed contract all existing generators already satisfyRenderBackenddataclass withfrom_config()factory (tools/render_backend.py) that handles class instantiation and rate limiter wiring from YAML configinit_from_config()boilerplate in bothScript2VideoPipelineandIdea2VideoPipelinewith a 4-lineRenderBackend.from_config()callZero 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