[modular] `ConditionalPipelineBlocks` should declare its own trigger inputs
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
Start by reading ConditionalPipelineBlocks.inputs and how ModularPipeline.__call__ copies declared inputs into state; compare the Cosmos 3 enable_sound override described in the issue. The change should let a conditional wrapper declare its trigger inputs with type, default, and description so they appear in inputs, generated docstrings, and default call parameters. Check that runtime calls and workflow resolution preserve the intended behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
When an input exists only to decide which branch a conditional block runs, no sub-block reads it, so nothing declares it. ConditionalPipelineBlocks.inputs only merges the sub-blocks' inputs and does not add the block's own block_trigger_inputs. The repo has three patterns for this:
-
Declare it nowhere. Ernie's
use_peis only listed inblock_trigger_inputs:class ErnieImageAutoPromptEnhancerStep(ConditionalPipelineBlocks): block_trigger_inputs = ["use_pe"] def select_block(self, use_pe=None): return "prompt_enhancer" if use_pe else Noneuse_peis missing frominputs, from the generated docstring and fromdefault_call_parameters. And it does not work at call time either:ModularPipeline.__call__only copies declared inputs into the state and warns about the rest, sopipe(prompt=..., use_pe=True)prints "Unexpected input 'dict_keys(['use_pe'])' provided. This input will be ignored.", the conditional block readsNonefrom the state, and the prompt enhancer never runs. Only the staticget_execution_blocks(prompt=True, use_pe=True)resolves to it, because that takes kwargs directly. -
Override
inputson the wrapper. Cosmos 3'senable_sound:class Cosmos3AutoCoreDenoiseStep(ConditionalPipelineBlocks): block_trigger_inputs = ["action", "enable_sound", "control_videos"] @property def inputs(self): inputs = super().inputs inputs.append(InputParam(name="enable_sound", type_hint=bool, default=False, description="...")) return inputsThe input is listed at the top level with a type, a default and a description. And because
enable_soundis also a workflow input,get_workflowdoes the right thing with it:>>> blocks = Cosmos3OmniBlocks() >>> wf = blocks.get_workflow("text2video_with_sound") >>> [name for name in wf.sub_blocks if "sound" in name] ['denoise.prepare_sound_latents', 'denoise.pack_sound_sequence', 'denoise.prepare_sound_denoiser_inputs', 'decode.sound'] >>> "enable_sound" in [p.name for p in wf.inputs] FalseThe workflow resolves to the sound blocks, and the resolved workflow does not list
enable_soundas an input, which is correct: none of the resolved blocks reads it, the workflow entry has already decided it.get_execution_blocksworks the same way,get_execution_blocks(prompt=True, enable_sound=True)resolves to the same sound blocks, sinceget_workflowis justget_execution_blockscalled with the workflow entry. Ifenable_soundwere not a workflow input,get_workflowwould resolve the wrapper with the default and the input would be lost together with it, see #15100. -
Declare it on every leaf. LTX-2's
enable_prompt_enhancementis read only byLTX2AutoPromptEnhancerStep.select_block, but it is declared as anInputParamon each of the three prompt-enhancer leaves it chooses between:class LTX2PromptEnhancerStep(ModularPipelineBlocks): @property def inputs(self): return [ InputParam.template("prompt", required=True), InputParam("enable_prompt_enhancement", type_hint=bool, default=False, description="..."), ..., ]The leaves carry an input they never read, each new leaf has to repeat the declaration, and a resolved workflow that keeps such a leaf lists the input although nothing on that workflow acts on it.
I think the Cosmos 3 pattern is the right one: the wrapper is the block that reads the input, so the wrapper declares it, with a type, a default and a description like any other input, so it shows up in inputs, in the generated docstring and in default_call_parameters. The framework should make this the documented way instead of leaving it to each blockset to work out. The Cosmos 3 inputs override is the shape of it; the base class could offer a small hook for it so the override does not have to re-merge the sub-blocks' inputs, but that is a detail.
Posted by Claude Code on behalf of @yiyixuxu, who reviewed and approved this text.
- Linguagem predominante
- Python
- Estrelas
- 35k
- Forks
- 7.5k
- Merge médio
- 2d 22h
- PRs com merge (30d)
- 58
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de huggingface/diffusers
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
huggingface/diffusers#15436 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omittedTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
huggingface/diffusers#15433 ·
Mantenedores costumam responder em até 1 dia
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0Talvez já em andamento @hparik11 assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
huggingface/diffusers#15423 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Docs: 13 docstrings document parameters their functions don't haveTalvez já em andamento @M-Colley assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
huggingface/diffusers#15363 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorTalvez já em andamento @chessing234 assumiu há 11 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
huggingface/diffusers#15337 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de huggingface/diffusers
Issues semelhantes
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount dueTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 79/100
developmentseed/titiler-covjson#164 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
awslabs/visual-asset-management-system#2164 ·
Mantenedores costumam responder em até 1 dia
-
needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
MakazhanAlpamys/Soup#3589 ·
Mantenedores costumam responder em até 1 dia
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocketAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
Mantenedores costumam responder em até 1 dia