-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve FLUX image-to-image (Trajectory Guidance) (#6900)
## Summary This PR makes some improvements to the FLUX image-to-image and inpainting behaviours. Changes: - Expand inpainting region at a cutoff timestep. This improves seam coherence around inpainting regions. - Add Trajectory Guidance to improve the ability to control how much an image gets modified during image-to-image/inpainting (see the code for a more technical explanation - it's well-documented). ## `trajectory_guidance_strength` Usage - The `trajectory_guidance_strength` param has been added to the `FLUX Denoise` invocation. - `trajectory_guidance_strength` defaults to `0.0` and should be in the range [0, 1]. - `trajectory_guidance_strength = 0.0` has no effect on the denoising process. - `trajectory_guidance_strength = 1.0` will guide strongly towards the original image. ## FLUX image-to-image usage tips - As always, prompt matters a lot. - If you are trying to making minor perturbations to an image, use vanilla image-to-image by setting the `denoising_start` param. - If you are trying to make significant changes to an image, using trajectory guidance will give more control than using vanilla image-to-image. Set `denoising_start=0.0` and adjust `trajectory_guidance_strength` to control the amount of change in the image. - The 'transition point' where the image changes the most as you adjust `trajectory_guidance_strength` or `denoise_start` varies depending on the noise. So, set a fixed noise seed, then tune those params. ## QA Instructions - [x] Vanilla image-to-image - No change in output - [x] Vanilla inpainting - No change in output - [x] Vanilla outpainting - No change in output - Trajectory Guidance image-to-image - [x] TGS = 0.0 is identical to Vanilla case - [x] TGS = 1.0 guides close to the original image - Not as close as I'd like, but it's not broken. - [x] Smooth transition as TGS varies - [x] Smoke test: TGS with denoise_start > 0.0 - TG inpainting - [x] TGS = 0.0 is identical to Vanilla case - [x] TGS = 1.0 guides close to the original image - Not as close as I'd like, but it's not broken - [x] Smooth transition as TGS varies - [x] Smoke test: TGS with denoise_start > 0.0 - TG outpainting - [x] TGS = 0.0 is identical to Vanilla case - [x] Smoke test TGS outpainting - [x] Smoke test FLUX text-to-image - [x] Preview images look ok for all of above. ## Known issues (will be addressed in follow-up PRs) - The current TGS scale biases towards creating more change than desired in the image. More tuning of the TG change schedule is required. - TGS does not work very well for outpainting right now. This _might_ be solvable, but more likely we'll just want to discourage it in the Linear UI. ## Merge Plan No special instructions. ## 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)_
- Loading branch information
Showing
14 changed files
with
418 additions
and
131 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.