feat(image-gen): add ModelScope backend for image generation#83
Merged
Conversation
Introduces a new image generation backend using ModelScope (魔塔社区) API with support for Z-Image-Turbo and other models. Key features: - Async task-based generation workflow with polling - Multiple resolution presets (512px, 1K, 2K, 4K) - Aspect ratio support (1:1, 3:4, 4:3, 9:16, 16:9) - Configurable via MODELSCOPE_API_KEY, MODELSCOPE_MODEL, MODELSCOPE_BASE_URL Configuration: IMAGE_BACKEND=modelscope MODELSCOPE_API_KEY=your-api-key MODELSCOPE_MODEL=Tongyi-MAI/Z-Image-Turbo (default) MODELSCOPE_BASE_URL=https://api-inference.modelscope.cn/v1 (default) Also updates .gitignore to exclude Python version files and build artifacts.
Owner
|
I recommend not merging this PR yet. Adding ModelScope as an image backend is a reasonable direction and it fits as an experimental backend, but the current implementation does not meet the minimum behavior contract used by the existing image backends in this repository. Blocking issues:
Suggested minimal fixes:
Platform-wise, ModelScope is worth supporting, especially for Chinese prompts, domestic access, and the open-source/LoRA model ecosystem. However, its image API examples vary between synchronous and asynchronous response shapes, so this backend needs conservative handling for task state, timeouts, missing fields, and download failures. I would keep it experimental after these fixes and avoid promoting it to a core backend for now. |
- 移动 .env.example 中 ModelScope 配置位置到Extended / Experimental backends区 - 实现 ModelScope 异步图任务轮询使用`skills\ppt-master\scripts\image_backends\backend_common.py`中的`poll_json()`函数 - 修复 ModelScope URL 解析逻辑,不强制以`.cn`结尾 - 从 .gitignore 移除上次添加的额外内容
mosjin
added a commit
to mosjin/ppt-master
that referenced
this pull request
May 4, 2026
- shared-standards.md Basic SVG Rules: - 内容文字 font-size ≥ 15px (UI chrome 11-12px 除外) - 所有 <text> 必须显式携带 font-weight (最低500, 标题700+) - 明确: 缺失 font-weight 默认400 = 投影屏上细若发丝 - 禁止 font-style="italic" 于内容文字
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.
feat(image-gen): add ModelScope backend for image generation
Introduces a new image generation backend using ModelScope (魔塔社区)
API with support for Z-Image-Turbo and other models.
Key features:
Async task-based generation workflow with polling
Multiple resolution presets (512px, 1K, 2K, 4K)
Aspect ratio support (1:1, 3:4, 4:3, 9:16, 16:9)
Configurable via MODELSCOPE_API_KEY, MODELSCOPE_MODEL, MODELSCOPE_BASE_URL
Configuration:
IMAGE_BACKEND=modelscope
MODELSCOPE_API_KEY=your-api-key
MODELSCOPE_MODEL=Tongyi-MAI/Z-Image-Turbo (default)
MODELSCOPE_BASE_URL=https://api-inference.modelscope.cn/v1 (default)
Also updates .gitignore to exclude Python version files and build artifacts.