feat: add Hunyuan Image Generation 3.0 (混元生图) via TokenHub API - #458
Open
clarkhjc wants to merge 1 commit into
Open
feat: add Hunyuan Image Generation 3.0 (混元生图) via TokenHub API#458clarkhjc wants to merge 1 commit into
clarkhjc wants to merge 1 commit into
Conversation
Async text-to-image tool using Tencent TokenHub (hy-image-v3.0). Parameters mirror upstream SubmitTextToImageJob API: prompt, resolution, seed, revise, logo_add, logo_param, and reference images via Images.N. - tools/graphics/hunyuan_image.py: submit → poll → download flow, matching hunyuan_cloud_video.py code style - tests/tools/test_hunyuan_image.py: 32 unit tests covering payload building, image resolution, API error handling, and mocked e2e flow
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
Add Hunyuan Image Generation 3.0 (混元生图) tool via Tencent TokenHub API, matching the code style of
hunyuan_cloud_videotool. Uses the sameTENCENT_TOKENHUB_API_KEYcredential and Bearer-token auth — no additional setup required for existing Hunyuan users.Changes
tools/graphics/hunyuan_image.py: new tool using async submit-poll-download flow viahy-image-v3.0model. Parameters mirror the upstream SubmitTextToImageJob API: prompt, resolution, seed, revise, logo_add, logo_param, and reference images via Images.N. Built fromhunyuan_cloud_video.pyas a base, sharing the same_auth_headers(),_json_or_raise(),_check_response(), and_safe_error()helpers.tests/tools/test_hunyuan_image.py: 32 unit tests covering registry discovery, payload building, image resolution, API error handling, and a mocked e2e submit→poll→download flow with a sentinel to catch leaked real API calls.Testing
Manually verified end-to-end with TENCENT_TOKENHUB_API_KEY — image generation, polling, and file download all work correctly. Also verified the selector test (test_image_selector_no_provider) no longer leaks image files to CWD.
Checklist