Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TiledMultiDiffusionDenoiseLatents invocation (for upscaling workflows) #6522

Merged
merged 63 commits into from
Jun 25, 2024

Conversation

RyanJDick
Copy link
Collaborator

@RyanJDick RyanJDick commented Jun 19, 2024

Summary

This PR adds a TiledMultiDiffusionDenoiseLatents invocation. This invocation has an interface similar to that of the DenoiseLatentsInvocation, but uses MultiDiffusion internally to perform tiled denoising. The primary intended use case for this node is in tiled upscaling workflows.

This PR refactors (and tidies) the StableDiffusionGeneratorPipeline class to facilitate sharing most of the core logic between standard and MultiDiffusion denoising.

Workflows

Here are some test workflows that use the new invocation:

Screenshot of multi_diffusion_esrgan_x2_upscaling.json:
image

Sample Outputs from Upscaling

Before (352x352):
image

After 4x (1408x1408):
image

Before (842x842):
image

After 4x (3360x3360):
3c5f04e9-c60a-4ee5-84ee-b624b19b3bab

QA Instructions

Test plan:

  • SD 1.5 regression tests (no change expected on these workflows with this PR)
    • Text-to-image
    • Image-to-image
    • Inpainting with non-inpainting model
    • Inpainting with inpainting model
    • Text-to-image with an inpainting model
    • Regional text conditioning and regional IP-Adapter (just a smoke test - this shouldn't be affected)
  • SDXL regression tests (no change expected on these workflows with this PR)
    • Text-to-image
    • Image-to-image
    • Inpainting with non-inpainting model
  • Multi-Diffusion tests
    • SD 1.5 upscaling workflow
    • SDXL upscaling workflow
    • Try to break it with awkward input image dimensions

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations backend PRs that change backend files labels Jun 19, 2024
@psychedelicious
Copy link
Collaborator

I focused on the code changes that don't interact with ML stuff - LGTM.

@RyanJDick RyanJDick marked this pull request as ready for review June 25, 2024 17:55
…nvocation so that it can be called from other invocations.
…t that has been superseded by TiledMultiDiffusionDenoiseLatents.
…ound. It is simply the first element of the timesteps array.
…amount of overlap rather than being a lower bound.
…nts invocation. This is more natural for many users.
@hipsterusername hipsterusername enabled auto-merge (rebase) June 25, 2024 18:24
@hipsterusername hipsterusername merged commit cd9dfef into main Jun 25, 2024
14 checks passed
@hipsterusername hipsterusername deleted the ryan/multi-diffusion branch June 25, 2024 18:31
RyanJDick added a commit that referenced this pull request Jun 26, 2024
## Summary

#6522 introduced a change in
behavior in cases where start/end were set such that there are 0
timesteps. This PR reverts that change.

cc @StAlKeR7779 

## QA Instructions

Run with euler, 5 steps, start: 0.0, end: 0.05. I ran this test before
#6522, after #6522, and on this branch. This branch restores the
behavior to pre-#6522 i.e. noise is injected even if no denoising steps
are applied.


## Checklist

- [x] _The PR has a short but descriptive title, suitable for a
changelog_
- [x] _Tests added / updated (if applicable)_
- [x] _Documentation added / updated (if applicable)_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend PRs that change backend files invocations PRs that change invocations python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants