[Modular] Krea2 Img2Img, Inpaint and Reference Images modular pipeline - #14370
Open
lucasruan1618 wants to merge 2 commits into
Open
[Modular] Krea2 Img2Img, Inpaint and Reference Images modular pipeline#14370lucasruan1618 wants to merge 2 commits into
lucasruan1618 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds img2img, inpainting, and reference-conditioned generation to the Krea 2 Raw and Turbo modular pipelines. It resolves #14290.
The modular pipeline automatically selects the workflow from the supplied inputs:
imageruns img2img.imageandmask_imageruns inpainting.reference_imageruns reference-conditioned generation from pure noise.reference_imagesupports any number of references, with optional per-reference attention scaling.The reference workflow is generic and can be used by LoRAs trained with clean reference-image tokens, including Krea 2 Identity Edit.
Img2img example
Inpainting example
Img2img results at different strengths
Inpainting results at different strengths
Why strengths 0.9 and 1.0 produce the same result
These examples use only 8 inference steps. The strength calculation effectively uses
t_start = int(8 - 8 * strength). Forstrength=0.9,int(0.8)is0; forstrength=1.0, it is also0. Both strengths therefore use the same full 8-step denoising schedule. With identical inputs and generator seed, img2img and inpainting produce identical outputs. This is expected discrete-step rounding behavior.One-reference example
With one reference, generation starts from pure noise while the reference supplies the subject identity and image-grounded prompt context.
Two-reference example
reference_imageaccepts an ordered list of any length. In this example, the first reference supplies the scene and composition while the second supplies the subject. The attention scale can be set separately for each reference.Before submitting
self-reviewskill on the diff?documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR !