Skip to content

💄 style: add wanxiang2.7 & keling ImageGen from Qwen#13478

Merged
tjx666 merged 3 commits intolobehub:canaryfrom
hezhijie0327:wan2.7
Apr 3, 2026
Merged

💄 style: add wanxiang2.7 & keling ImageGen from Qwen#13478
tjx666 merged 3 commits intolobehub:canaryfrom
hezhijie0327:wan2.7

Conversation

@hezhijie0327
Copy link
Copy Markdown
Contributor

@hezhijie0327 hezhijie0327 commented Apr 1, 2026

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔗 Related Issue

🔀 Description of Change

  1. 增加 wan2.7-image wan2.7-image-pro kling/kling-v3-image-generation kling/kling-v3-omni-image-generation
  2. 增加新的异步生图 Endpoint image-generation/generation 目前为新模型默认推荐 (Wan2.6, Wan2.6, Keling, etc)
  3. 增加 syncOnlyModels 模型列表,用于强制切换至同步生图 multimodal-generation/generation (qwen-image-edit/max, qwen-image-2.0, z-image-turbo)

Note:

  1. Keling 模型需要到百炼平台开通后使用

模型 截图 日志
kling/kling-v3-image-generation image image
kling/kling-v3-omni-image-generation image
wan2.7-image image

🧪 How to Test

  • Tested locally
  • Added/updated tests
  • No tests needed

📸 Screenshots / Videos

Before After
... ...

📝 Additional Information

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

@hezhijie0327 is attempting to deploy a commit to the LobeHub OSS Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @hezhijie0327, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@lobehubbot
Copy link
Copy Markdown
Member

@arvinxx Could you review this PR? It adds wanxiang2.7 and keling image generation models to the Qwen provider, including a new async image generation endpoint.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 75.90361% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.51%. Comparing base (aec2d30) to head (b72db3b).
⚠️ Report is 3 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #13478      +/-   ##
==========================================
+ Coverage   66.50%   66.51%   +0.01%     
==========================================
  Files        1995     1995              
  Lines      165151   165264     +113     
  Branches    15938    16726     +788     
==========================================
+ Hits       109834   109930      +96     
- Misses      55195    55212      +17     
  Partials      122      122              
Flag Coverage Δ
app 58.30% <ø> (+0.01%) ⬆️
database 92.57% <ø> (ø)
packages/agent-runtime 88.98% <ø> (ø)
packages/context-engine 86.51% <ø> (ø)
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 66.68% <ø> (ø)
packages/model-bank 99.85% <ø> (ø)
packages/model-runtime 84.66% <75.90%> (-0.07%) ⬇️
packages/prompts 65.80% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.02% <ø> (ø)
packages/web-crawler 88.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 66.88% <ø> (ø)
Services 49.50% <ø> (ø)
Server 65.97% <ø> (+<0.01%) ⬆️
Libs 51.03% <ø> (ø)
Utils 91.01% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hezhijie0327 hezhijie0327 marked this pull request as ready for review April 1, 2026 15:27
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @hezhijie0327, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9126fe0388

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

/^wan2\.(2|5)-t2i-/,
/^wanx2\.(0|1)-t2i-/,
/^wanx-v1/,
/^qwen-image(-plus)?$/,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep qwen-image models off legacy size-defaulted route

Adding ^qwen-image(-plus)?$ to text2ImageModels routes qwen-image and qwen-image-plus through createLegacySynthesisTask, which injects a default size: '1024*1024' whenever the caller omits size. These two models are declared with constrained size enums in packages/model-bank/src/aiModels/qwen.ts (1664x928, 1472x1140, 1328x1328, 1140x1472, 928x1664), so OpenAI-compatible calls without an explicit size can now send an unsupported size and fail at runtime. Before this commit they used the multimodal path, which did not force this default size.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hezhijie0327 check 下这个

Copy link
Copy Markdown
Contributor Author

@hezhijie0327 hezhijie0327 Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

符合预期的, qwen-image 和 qwen-image-plus 支持 text2imagecreateLegacySynthesisTask

image image

style: add wanxiang2.7 support

style: add keling support

feat: support new async method

feat: support new async method

feat: support new async method

feat: support new async method
style: add wan2.7 videoGen models

style: add wan2.7 videoGen models
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 3, 2026 8:21am

Request Review

@tjx666
Copy link
Copy Markdown
Member

tjx666 commented Apr 3, 2026

Code review findings after verifying against full source code:

Issues

1. [high] wan2.6-image lost image-required validation — packages/model-runtime/src/providers/qwen/createImage.ts

imageRequiredModels includes /^wan2\.6-image/, but the validation check only exists inside createHTTPSyncGeneration (~line 236). Since the default route changed from sync to async, wan2.6-image now goes through createHTTPAsyncGenerationTask, which completely bypasses the image-required validation. Users calling wan2.6-image without providing an image will no longer get a helpful error message — they'll get a raw Alibaba API error instead.

Suggestion: move the imageRequiredModels validation up to the createQwenImage entry point, or duplicate it in createHTTPAsyncGenerationTask.

2. [medium] Default route changed from sync to async — behavioral change affects existing models

Previously, unmatched models defaulted to multimodal-generation/generation (sync). Now they default to image-generation/generation (async polling). Affected existing models include wan2.6-image and wan2.6-t2i. New models (wan2.7, kling) are added by this PR so they should be fine, but wan2.6-* models existed before — please confirm they work correctly on the new async image-generation endpoint.

3. [low] Error double-wrapping in createLegacySynthesisTask (pre-existing)

createLegacySynthesisTask throws AgentRuntimeError.createImage(...) directly for its missing-imageUrls validation (~line 102), but the outer createQwenImage catch wraps it again with AgentRuntimeError.createImage(...). This nests one AgentRuntimeError inside another, losing the inner errorType. By contrast, createHTTPAsyncGenerationTask throws plain Error which avoids this. Pre-existing issue, but could be cleaned up during this refactor.

4. [low] Redundant /r2v$/ in image2VideoModelspackages/model-runtime/src/providers/qwen/createVideo.ts

/r2v$/ appears in both image2VideoModels and reference2VideoModels. Due to the else if chain, reference2VideoModels (branch 5) is checked before image2VideoModels (branch 7), so r2v models always get reference-to-video treatment. The /r2v$/ entry in image2VideoModels is redundant and misleading — it could be removed without changing any behavior.

5. [low] Missing $ anchors on syncOnlyModels regexes

/^qwen-image-(edit|max)/, /^qwen-image-2\.0/, /^z-image-turbo/ all use prefix matching without $. This works for all current models, but future models with the same prefix but different API requirements would be silently misrouted. Consider adding a comment to clarify this is intentional prefix matching.

@hezhijie0327
Copy link
Copy Markdown
Contributor Author

hezhijie0327 commented Apr 3, 2026

FYI.

  1. Fixed
  2. Works as expected, approved
  3. Fixed
  4. Removed
  5. Works as expected

This comment was translated by Claude.

Original Content

FYI.

  1. 已修复
  2. 符合预期,支持
  3. 已修复
  4. 已移除
  5. 符合预期

@tjx666 tjx666 merged commit 210f020 into lobehub:canary Apr 3, 2026
20 of 21 checks passed
@lobehubbot
Copy link
Copy Markdown
Member

❤️ Great PR @hezhijie0327 ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.

@hezhijie0327 hezhijie0327 deleted the wan2.7 branch April 3, 2026 09:18
arvinxx added a commit that referenced this pull request Apr 7, 2026
# 🚀 release: 20260407

This release includes **148 commits**. Key updates are below.

- **Response API tool execution is more capable and reliable** — Added
hosted builtin tools + client-side function tools and improved tool-call
streaming/completion behavior.
[#13406](#13406)
[#13414](#13414)
[#13506](#13506)
[#13555](#13555)
- **Input and composition UX upgraded** — Added AI input auto-completion
and multiple chat-input stability fixes.
[#13458](#13458)
[#13551](#13551)
[#13481](#13481)
- **Model/provider compatibility improved** — Better Gemini/Google tool
schema handling and additional model updates.
[#13429](#13429)
[#13465](#13465)
[#13613](#13613)
- **Desktop and CLI reliability improved** — Gateway WebSocket support
and desktop runtime upgrades.
[#13608](#13608)
[#13550](#13550)
[#13557](#13557)
- **Security hardening continued** — Fixed auth and sanitization risks
and upgraded vulnerable dependencies.
[#13535](#13535)
[#13529](#13529)
[#13479](#13479)

### Models & Providers

- Added/updated support for `glm-5v-turbo`, GLM-5.1 updates, and
qwen3.5-omni series.
[#13487](#13487)
[#13405](#13405)
[#13422](#13422)
- Added additional ImageGen providers/models (Wanxiang 2.7 and Keling
from Qwen). [#13478](#13478)
- Improved Gemini/Google tool schema and compatibility handling across
runtime paths. [#13429](#13429)
[#13465](#13465)
[#13613](#13613)

### Response API & Runtime

- Added hosted builtin tools in Response API and client-side function
tool execution support.
[#13406](#13406)
[#13414](#13414)
- Improved stream tool-call argument handling and `response.completed`
output correctness.
[#13506](#13506)
[#13555](#13555)
- Improved runtime error/context handling for intervention and provider
edge cases. [#13420](#13420)
[#13607](#13607)

### Desktop App

- Bumped desktop dependencies and runtime integrations (`agent-browser`,
`electron`). [#13550](#13550)
[#13557](#13557)
- Simplified desktop release channel setup by removing nightly release
flow. [#13480](#13480)

### CLI

- Added OpenClaw migration command.
[#13566](#13566)
- Added local device binding support for `lh agent run`.
[#13277](#13277)
- Added WebSocket gateway support and reconnect reliability
improvements. [#13608](#13608)
[#13418](#13418)

### Security

- Removed risky `apiKey` fallback behavior in webapi auth path to
prevent bypass risk.
[#13535](#13535)
- Sanitized HTML artifact rendering and iframe sandboxing to reduce
XSS-to-RCE risk. [#13529](#13529)
- Upgraded nodemailer to v8 to address SMTP command injection advisory.
[#13479](#13479)

### Bug Fixes

- Fixed image generation model default switch issues.
[#13587](#13587)
- Fixed subtopic re-fork message scope behavior and agent panel reset
edge cases. [#13606](#13606)
[#13556](#13556)
- Fixed chat-input freeze on paste and mention plugin behavior.
[#13551](#13551)
[#13415](#13415)
- Fixed auth/social sign-in and settings UX edge cases.
[#13368](#13368)
[#13392](#13392)
[#13338](#13338)

### Credits

Huge thanks to these contributors:

@chriszf @hardy-one @Innei @lijian @neko @OctopusNote @rdmclin2
@rivertwilight @RylanCai @suyua9 @sxjeru @Tsuki @wangyk @WindSpiritSR
@yizhuo @YuTengjing @hezhijie0327 @arvinxx
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.

4 participants