Skip to content

Implement missing features on ModularPipeline #12386

Open

Description

@vladmandic

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)

cc @yiyixuxu @DN6 @sayakpaul

Activity

  1. added
    roadmap
    on Sep 29, 2025
  2. github-actions commented on Jan 9, 2026

    @github-actions
    Contributor

    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.

  3. added
    stale
    on Jan 9, 2026
  4. removed
    stale
    on Jan 10, 2026
  5. yiyixuxu commented on Jan 10, 2026

    @yiyixuxu
    Collaborator

    we will add support for callback etc

  6. moved this from Todo to Future Release in Diffusers Roadmapon Jan 15, 2026
  7. github-actions commented on Feb 3, 2026

    @github-actions
    Contributor

    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.

  8. added
    stale
    on Feb 3, 2026
  9. vladmandic commented on Aug 28, 2026

    @vladmandic
    ContributorAuthor

    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

  10. yiyixuxu commented on Oct 6, 2026

    @yiyixuxu
    Collaborator

    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:

    for event in pipe.stream(prompt=...):
          latent = event.state.get("latents")
  11. vladmandic commented on Oct 16, 2026

    @vladmandic
    ContributorAuthor

    @yiyixuxu @sayakpaul

    #14159 is a cool new design, but...

    1. its going to be a while until its adopted by ALL modular pipelines, especially since it requires switch to IterativePipelineblocks
    2. there is so much code already written with callbacks in mind.
    3. feedback in [Modular]improve loop block #14159 (comment) does raise several more issues

    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.

  12. yiyixuxu commented on Oct 16, 2026

    @yiyixuxu
    Collaborator

    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_end to 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.insert examples 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 with update_components(...).

  13. removed
    roadmap
    on Oct 16, 2026
  14. vladmandic commented on Oct 16, 2026

    @vladmandic
    ContributorAuthor

    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.

  15. yiyixuxu commented on Oct 16, 2026

    @yiyixuxu
    Collaborator

    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_end
    https://huggingface.co/docs/diffusers/main/en/using-diffusers/callback#modular-pipelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions