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

Hooks disabled at first step of a second SamplerCustomAdvanced node #6183

Open
catboxanon opened this issue Dec 23, 2024 · 1 comment · May be fixed by #6185
Open

Hooks disabled at first step of a second SamplerCustomAdvanced node #6183

catboxanon opened this issue Dec 23, 2024 · 1 comment · May be fixed by #6185
Labels
Potential Bug User is reporting a bug. This should be tested.

Comments

@catboxanon
Copy link
Contributor

catboxanon commented Dec 23, 2024

Expected Behavior

Results are identical when a hook LoRA is enabled and multiple SamplerCustomAdvanced nodes are used.

Actual Behavior

Results are not identical when a hook LoRA is enabled and multiple SamplerCustomAdvanced nodes are used. They are only identical if no hook is used.

Steps to Reproduce

See workflow: hook-test.json

Any model and LoRA is usable to reproduce this issue.

1) Result using 1 SamplerCustomAdvanced node, with hooks

image

2) Result using 2 SamplerCustomAdvanced nodes, with hooks (expected to match with result 1)

image

3) Result using 1 or 2 SamplerCustomAdvanced nodes, without hooks (matches as expected)

image

The last result in this list can be obtained by bypassing the Set CLIP Hooks node. (Ctrl + B)

Debug Logs

n/a

Other

A use case of a workflow like this, though not shown in this workflow in order to keep things straightforward, would be to sample for a longer duration in high sigma values, or to flip the latent halfway through sampling.

I've also mentioned in this issue title that hooks seem disabled in the first step based on what the sampling preview produces, and also the brief lag after 1 step is performed in the second SamplerCustomAdvanced node (which does not occur when hooks are disabled).

Version info

image

@catboxanon catboxanon added the Potential Bug User is reporting a bug. This should be tested. label Dec 23, 2024
@catboxanon catboxanon changed the title Hooks seemingly disabled at first step of a second SamplerCustomAdvanced node Hooks disabled at first step of a second SamplerCustomAdvanced node Dec 23, 2024
@catboxanon
Copy link
Contributor Author

catboxanon commented Dec 23, 2024

Can confirm this is actually happening after adding some rough debug logging before this line here.

        try:
            logging.info(combined_patches[list(combined_patches.keys())[0]][0][0])
        except IndexError:
            pass

Progress output looks something like this in the console. The expectation would be only 1.0 is printed at step 0 (first step) of sampling, not tensor(0.) at step 0 followed by 1.0 at step 1 (after one step has already been completed).

Note I adjusted the end_percent value to 0.1 in the Create Hook Keyframes Interp node to make it more clear that the hook is supposed to "finish" during the first sampling pass.

  0%| 0/20  [    ] tensor(0.)
 15%| 3/20  [    ] tensor(0.2500)
 25%| 5/20  [    ] tensor(0.5000)
 40%| 8/20  [    ] tensor(0.7500)
 50%| 10/20 [    ] 1.0
100%| 20/20 [    ]

  0%| 0/80  [    ] tensor(0.)
  1%| 1/80  [    ] 1.0
100%| 80/80 [    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug User is reporting a bug. This should be tested.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant