[modular] Per-workflow input signature in the docstring of blocks with `_workflow_map`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 58/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
Read #15136 and inspect how blocks with _workflow_map build their input docstrings, then find the renderer in modular_pipeline_utils.py that produces the model-card documentation. Compare the rendered inputs with get_workflow(name).inputs, including shared inputs and workflow-specific required flags and defaults. Done means both docstrings group inputs correctly by workflow and show the right required and default information.
由索引模型根据 Issue 内容生成。
描述
Follow-up to #15136.
For the final assembled blocks that support workflows (the ones with _workflow_map, i.e. the auto blocks a checkpoint maps to), the signature and the docstring aren't informative enough. An input is listed, but you don't know which workflow actually uses it, whether it's required there, or what its default is, since the defaults can differ between workflows.
Today the way to see the exact signature is to prune the blocks with get_workflow(name) and look at .inputs on the result. That works, but it is better to put that information in the docstring for the users.
This PR proposes a better docstring for these blocks, limited to blocks that define _workflow_map: per workflow, the inputs it takes with their required flag and default, with the inputs that are the same in every workflow listed once.
Examples
AnimaAutoBlocks
Today (after #15136):
Supported workflows:
- `text2image`: requires `prompt`
- `img2img`: requires `image`, `prompt`
Inputs:
prompt (`str`):
The prompt or prompts to guide image generation.
negative_prompt (`str`, *optional*):
...
image (`Image | list`, *optional*, depends on the workflow, see `vae_encoder`):
Reference image(s) for denoising. Can be a single image or list of images.
...
strength (`float`, *optional*, defaults to 0.9):
Strength for img2img/inpainting.
...
image is optional in the list but required for img2img. strength reads like a general input, but text2image does not use it.
Proposed:
Supported workflows:
- `text2image`: requires `prompt`
- `img2img`: requires `image`, `prompt`
Inputs (all workflows):
prompt (`str`):
The prompt or prompts to guide image generation.
negative_prompt (`str`, *optional*):
...
num_inference_steps (`int`, *optional*, defaults to 50):
...
Inputs (`img2img`):
image (`Image | list`):
Reference image(s) for denoising. Can be a single image or list of images.
strength (`float`, *optional*, defaults to 0.9):
Strength for img2img/inpainting.
MiniMaxH3Blocks
Today:
Supported workflows:
- `t2va`: requires `prompt`
- `fl2va`: requires `prompt`, `image` or `prompt`, `last_image`
- `ref2va`: requires `prompt`, `references`
Inputs:
...
references (`list`, *optional*, depends on the workflow, see `...`):
...
num_frames (`int`, *optional*):
Number of frames to generate, at the fixed 24 fps. ...
image (`Image`, *optional*):
...
last_image (`Image`, *optional*):
...
num_frames shows as optional with no default. In t2va and fl2va it defaults to 124, in ref2va it is required (the model reads the length from the references). The docstring can't say that today.
Proposed:
Inputs (all workflows):
prompt (`str`):
...
height (`int`, *optional*):
...
Inputs (`t2va`, `fl2va`):
num_frames (`int`, *optional*, defaults to 124):
Number of frames to generate, at the fixed 24 fps. ...
Inputs (`fl2va`):
image (`Image`, *optional*):
...
last_image (`Image`, *optional*):
...
Inputs (`ref2va`):
references (`list`):
...
num_frames (`int`):
Number of frames to generate, at the fixed 24 fps. ...
Each per-workflow section is get_workflow(name).inputs minus what is already in the shared list. The same renderer change applies to the model-card doc in modular_pipeline_utils.py, which already loops over _workflow_map but only prints the trigger inputs.
Posted by Claude Code on behalf of @yiyixuxu.
- 主要语言
- Python
- 星标
- 35k
- 派生
- 7.5k
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 58
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
huggingface/diffusers 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
huggingface/diffusers#15436 · 1 条评论 ·
维护者通常 1 天内回复
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omitted可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
huggingface/diffusers#15433 ·
维护者通常 1 天内回复
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0可能已有人在做 @hparik11 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
huggingface/diffusers#15423 · 2 条评论 ·
维护者通常 1 天内回复
-
Docs: 13 docstrings document parameters their functions don't have可能已有人在做 @M-Colley 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
huggingface/diffusers#15363 · 2 条评论 ·
维护者通常 1 天内回复
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeError可能已有人在做 @chessing234 于 11 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
huggingface/diffusers#15337 · 3 条评论 ·
维护者通常 1 天内回复
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount due可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 79/100
developmentseed/titiler-covjson#164 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
awslabs/visual-asset-management-system#2164 ·
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
MakazhanAlpamys/Soup#3589 ·
维护者通常 1 天内回复
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocket未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复