-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Uniform, Scheduled and randomized seeds depending on list or INT input #2129
base: master
Are you sure you want to change the base?
Conversation
fyi, this does set values to random ints which may break old workflows. not sure there is a workaround for this. |
It seems like this works for Euler, but not Euler Ancestral. Is that expected? |
…mess up existing KSamplers in workflows
Just want to make sure this gets answered. The reason ancestral samplers and other samplers that inject noise between timesteps is because they add random noise on their own. Fixed seed is mainly for deterministic samplers as they provide cleaner results for vid2vid workflows. |
The fixes for this PR have been implemented. The only reason the tests fail is it trips the check for adding a new option to the KSampler. The reason it's in the KSampler is for further modularity across a workflow to encourage experimentation. Increment and Decrement options also makes it easy to find the seed for a particular result in a batch you want to refine later in another workflow by adding the element's position in a batch. This is also follows suite wit the control_after_generation options. From the tests I have done with my company, it really is a hit. Feel free to test yourself with the same workflows provided earlier. |
@pythongosssss or @comfyanonymous, please remember to change the automated testing after merge so all tests later on don't error out. |
@@ -1343,6 +1342,7 @@ def INPUT_TYPES(s): | |||
"negative": ("CONDITIONING", ), | |||
"latent_image": ("LATENT", ), | |||
"denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}), | |||
"batch_behavior": (["randomize", "fixed", "increment", "decrement"],), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would need to be under optional
to avoid breaking presaved api workflows (and use ="some_default"
on the func params)
This PR allows lists of seed values to determine what seed is used for latents in a batch. Below are some examples of how to use this.
note: I am using my own custom node for this but you can use any node that outputs lists of ints to test
Randomize every latent after the first if it's an int:

Uniform seeds using a list of seeds at 0:

Scheduled seeds for specifying which latent should have a particular seed:

There was legacy code for doing this but it isn't very "plug and play". This alternative is pretty straight forward. Feel free to make any edits you feel are needed.
this image has the workflow I used for testing:
