Skip to content

Make T2I Adapters work with any resolution supported by the models #7215

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

Merged
merged 9 commits into from
Nov 1, 2024

Conversation

dunkeroni
Copy link
Contributor

@dunkeroni dunkeroni commented Oct 27, 2024

Summary

This change mimics the unet padding strategy to align T2I featuremaps with the latents during denoising. It also slightly adjusts the crop and scale logic so that the control will match the input image without shifting when it needs to pad.

Related Issues / Discussions

QA Instructions

Image generated at 1032x1024
image

Image generated at 1080x1040 to prove feature alignment.
image

Edge artifacts on the bottom and right are a result of SDXL's unet padding, and t2i influence will be cut off in those regions.

Merge Plan

Contingent on #7205
Currently the Canvas UI prevents users from generating non-64 resolutions while t2i adapter layers are active. Will leave this as a draft until fixing that.

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 Oct 27, 2024
@psychedelicious
Copy link
Collaborator

The UI checks are here: https://github.com/dunkeroni/InvokeAI/blob/t2i_resolution_hack/invokeai/frontend/web/src/common/hooks/useIsReadyToEnqueue.ts#L205-L243

Those don't look right to me - I think those 16s should be multiple... I think I just copy-pasted and didn't fix it. But anyways, if I understand correctly, that whole block of checks can be removed in this PR.

@github-actions github-actions bot added the frontend PRs that change frontend files label Oct 31, 2024
@dunkeroni
Copy link
Contributor Author

UI checks have been removed and T2I can now be used at arbitrary resolutions and scaling in the Canvas editor.
image

@hipsterusername hipsterusername enabled auto-merge (rebase) November 1, 2024 02:08
auto-merge was automatically disabled November 1, 2024 02:19

Rebase failed

@psychedelicious psychedelicious merged commit 016a6f1 into invoke-ai:main Nov 1, 2024
14 checks passed
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 frontend PRs that change frontend 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