Skip to content

Conversation

@blepping
Copy link
Contributor

here is a different approach compared to forcing the workflow to always run again when a CADS node is involved: we keep track of the last seen sigma. if we get a sigma that's higher, then the step counter gets reset. state is also now stored in self rather than the global CADS class.

this approach still isn't 100% perfect, there are two cases i can think of where it may fail:

  1. reusing the patched model again after sampling with scheduling or start/end steps in the sampler such that the sigma is lower than the last one seen by CADS. (i think this would be pretty hard to do in practice though)
  2. restart sampling probably won't work correctly, but step counting stuff doesn't really work correctly with it anyway so i don't think this approach is worse

@blepping
Copy link
Contributor Author

i didn't change it, but i also don't really understand why current_step is initialized to start_step rather than 0.

@asagi4
Copy link
Owner

asagi4 commented Mar 24, 2024

current_step is initialized to start_step to have the same logic as KSamplerAdvanced.

I think to have an implementation without corner case failures I'd need the pre-sampling hook, but this seems better than the NaN hack.

@asagi4 asagi4 merged commit d94fd54 into asagi4:master Mar 24, 2024
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