[None][feat] add Wan I2V generation example#14981
Conversation
Signed-off-by: Olivia Stoner <245287810+o-stoner@users.noreply.github.com>
Signed-off-by: Olivia Stoner <245287810+o-stoner@users.noreply.github.com>
|
/bot run --disable-fail-fast |
📝 WalkthroughWalkthroughThis PR adds image-to-video (I2V) capability to the VisualGen examples by introducing a new executable script ( ChangesVisualGen I2V Example
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
examples/visual_gen/models/wan_i2v.py (1)
31-31: ⚡ Quick winAdd explicit return type annotation to
main.
mainshould be annotated as returningNonefor typing/lint consistency.Suggested patch
-def main(): +def main() -> None:As per coding guidelines, "Always annotate functions; make the return type
Noneif the function does not return anything."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/visual_gen/models/wan_i2v.py` at line 31, Add an explicit return type annotation to the top-level function main by changing its signature to declare it returns None (i.e., annotate main as returning None). Update the definition of main() to def main() -> None: so it complies with the project's typing/lint rules; no other logic changes required.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/visual_gen/models/wan_i2v.py`:
- Around line 48-52: Add an early validation for the "--image" CLI argument
right after parsing (where parser.parse_args() is invoked) to fail fast if the
provided path is missing or not a file: use os.path.exists/os.path.isfile on
args.image and call parser.error(f"Image file not found: {args.image}") or
sys.exit with a clear message; apply the same pattern to the other CLI inputs in
this file (the second block around the 59-69 region) that accept file paths so
invalid paths are detected immediately (reference the "--image" argument,
args.image variable, parser.parse_args(), and the second file-path argument in
that section).
---
Nitpick comments:
In `@examples/visual_gen/models/wan_i2v.py`:
- Line 31: Add an explicit return type annotation to the top-level function main
by changing its signature to declare it returns None (i.e., annotate main as
returning None). Update the definition of main() to def main() -> None: so it
complies with the project's typing/lint rules; no other logic changes required.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: aece5031-7fd9-4b72-815d-5663468da22e
📒 Files selected for processing (3)
examples/visual_gen/README.mdexamples/visual_gen/configs/wan2.2-i2v-fp4-1gpu.yamlexamples/visual_gen/models/wan_i2v.py
|
PR_Github #52197 [ run ] triggered by Bot. Commit: |
|
PR_Github #52197 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #52386 [ run ] triggered by Bot. Commit: |
|
PR_Github #52386 [ run ] completed with state |
Summary by CodeRabbit
New Features
Documentation
Description
Added the Wan I2V example back to ToT following the pattern introduced by
wan_t2v.py.Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.