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 mid-kdiffusion cfgdenoiser script callback - access latents, conditionings and sigmas mid-sampling #4021

Merged
merged 5 commits into from
Nov 2, 2022

Conversation

dfaker
Copy link
Collaborator

@dfaker dfaker commented Oct 31, 2022

Briefly discussed in the context allowing scripts to force various symmetries onto the image latents here: #2441

Script with basic mirroring and rotation operation here:
https://gist.github.com/dfaker/ac031e87174a94d8a170d897caac9ff6

@AUTOMATIC1111
Copy link
Owner

AUTOMATIC1111 commented Nov 1, 2022

This kind of looks like if the user assigns something to those params in the callback, it won't have any effect. You either have to use fields from params in the code below, or re-assign local variables:

params = CGFDenoiserParams(x_in, image_cond_in, sigma_in, state.sampling_step, state.sampling_steps)
cfg_denoiser_callback(params)
x_in = params.x_in
...

Also let's not not name those _in and you should write description for what those fields do in params.

@dfaker
Copy link
Collaborator Author

dfaker commented Nov 2, 2022

Fair enough, I was imagining mutation of those properties in place as the useful ones are all objects, but assigning back now.

@dfaker dfaker marked this pull request as draft November 2, 2022 00:52
@dfaker dfaker marked this pull request as ready for review November 2, 2022 01:01
@AUTOMATIC1111 AUTOMATIC1111 merged commit 10f6254 into master Nov 2, 2022
@dfaker dfaker deleted the add-kdiff-cfgdenoiser-callback branch November 2, 2022 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants