You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement missing features on ModularPipeline #12386
as i'm looking to take advantage of new ModularPipeline ask is to implement some currently missing features
my use case is to convert existing loaded model using standard pipeline into modular pipeline. that functionality was provided via #11915 and is now working.
first minor obstacle is that modular pipeline does not have defined params for execution
in standard pipeline i can inspect __call__ signature to see which are allowed params
i currently work around this using possible = [input_param.name for input_param in model.blocks.inputs]
please advise if this is acceptable
second one is that modular pipelines don't seem to implement normal callbacks at all (e.g. callback_on_step_end_tensor_inputs? at the minimum we need some kind of callback functionality to capture interim latents on each step
third is more cosmetic - modular pipeline does implement set_progress_bar_config, but its not doing anything as its not implement on actual block (tested with StableDiffusionXLModularPipeline)
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
diffusers is moving to modular-only for new pipelines, but modular pipelines still dont have clear way to perform callbacks more than 6 months later?
cc @sayakpaul
hi hi
we will include this PR in next release #14159
it adds first-class streaming to modulaar pipelines, so you won't need the callback/interrupt mechanism from the standard pipeline: pipe.stream() let you work with the pipeline interactively:
all-in-all, we're a year into modular pipelines and they are still not functionally on-par with standard pipelines.
and as some models started moving to modular-only, it exposes more and more issues. for example, unpack/unpatchify latents were common/standardized methods on the pipelines. now they in modular blocks - but different modular pipelines place them in different blocks without a standard - and there is no clear way how to access them at all?
then going back to modular concept to start with - it uses frozen set, so once pipeline is initialized (not even loaded, just initialized), its not like i can add additional block as i want. that is anything but modular!
so i end up monkey-patching modular pipelines to intercept execution so i can perform additional code as needed. so far i have more monkey-patched code for modular pipelines than i ever needed for standard pipelines.
ok, then lets keep it on requirements level and not design: #14159 shows how to create a custom block and use it with new stream capabilities. how can that be done generic without needing to hard-coded custom block for every-single-supported-model-type. with diffusionpipeline it may not be an official standard, but it works for 90%+ of models.
Activity
github-actions commentedon Jan 9, 2026
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
yiyixuxu commentedon Jan 10, 2026
we have input_names property now
https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L504
also there is required_inputs https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L285
yiyixuxu commentedon Jan 10, 2026
we will add support for callback etc
github-actions commentedon Feb 3, 2026
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
vladmandic commentedon Aug 28, 2026
diffusers is moving to modular-only for new pipelines, but modular pipelines still dont have clear way to perform callbacks more than 6 months later?
cc @sayakpaul
Add step-end callbacks and interrupt to modular pipelines
yiyixuxu commentedon Oct 6, 2026
hi hi
we will include this PR in next release #14159
it adds first-class streaming to modulaar pipelines, so you won't need the callback/interrupt mechanism from the standard pipeline: pipe.stream() let you work with the pipeline interactively:
vladmandic commentedon Oct 16, 2026
@yiyixuxu @sayakpaul
#14159 is a cool new design, but...
IterativePipelineblocksall-in-all, we're a year into modular pipelines and they are still not functionally on-par with standard pipelines.
and as some models started moving to modular-only, it exposes more and more issues. for example, unpack/unpatchify latents were common/standardized methods on the pipelines. now they in modular blocks - but different modular pipelines place them in different blocks without a standard - and there is no clear way how to access them at all?
then going back to modular concept to start with - it uses frozen set, so once pipeline is initialized (not even loaded, just initialized), its not like i can add additional block as i want. that is anything but modular!
so i end up monkey-patching modular pipelines to intercept execution so i can perform additional code as needed. so far i have more monkey-patched code for modular pipelines than i ever needed for standard pipelines.
yiyixuxu commentedon Oct 16, 2026
modular is not meant to be 1:1 with standard API, there are differences and most of them are intentional
(1) callbacks: we are not going to add
callback_on_step_endto modular pipelines but you can insert a block into denoising loop yourself (see example https://huggingface.co/OzzyGT/krea2_preview_blocks)(2) unpack/pack: they are common but NOT a standard API on DiffusionPipeline, we can try to establish a standard on modular pipeline
(3) "frozen" blocks: this is intentional and well documented: in modular pipeline, blocks are mutable only before you create a pipeline. See the note in the ModularPipeline guide(https://huggingface.co/docs/diffusers/main/en/modular_diffusers/modular_pipeline#initpipeline) and the
sub_blocks.insertexamples in the quickstart (https://huggingface.co/docs/diffusers/main/en/modular_diffusers/quickstart#compose-new-workflows) and the custom blocks guide (https://huggingface.co/docs/diffusers/main/en/modular_diffusers/custom_blocks). The pipeline is stateful (components, loaded weights) and blocks are not so you should always get a new copy of blocks and turn it into a new pipeline if you want to modify, and pass the already-loaded components withupdate_components(...).vladmandic commentedon Oct 16, 2026
ok, then lets keep it on requirements level and not design: #14159 shows how to create a custom block and use it with new stream capabilities. how can that be done generic without needing to hard-coded custom block for every-single-supported-model-type. with diffusionpipeline it may not be an official standard, but it works for 90%+ of models.
yiyixuxu commentedon Oct 16, 2026
I added some notes in #15069. It includes a small block you can insert into the denoise loop of any modular pipeline, so you can keep using your existing
callback_on_step_endhttps://huggingface.co/docs/diffusers/main/en/using-diffusers/callback#modular-pipelines