[GH-ISSUE #12] index 49 is out of bounds for the schedule array, #8

Open
opened 2026-10-31 21:01:32 +00:00 by bsakaguchi · 14 comments
Owner

Originally created by @Krek12 on GitHub (Sep 27, 2024).
Original GitHub issue: https://github.com/muerrilla/sd-webui-detail-daemon/issues/12

*** Error executing callback cfg_denoiser_callback for /home/studio-lab-user/asd/extensions/sd-webui-detail-daemon/scripts/detail_daemon.py
Traceback (most recent call last):
File "/home/studio-lab-user/asd/modules/script_callbacks.py", line 333, in cfg_denoiser_callback
c.callback(params)
File "/home/studio-lab-user/asd/extensions/sd-webui-detail-daemon/scripts/detail_daemon.py", line 157, in denoiser_callback
multiplier = self.schedule[idx] * .1
IndexError: index 49 is out of bounds for axis 0 with size 25

Originally created by @Krek12 on GitHub (Sep 27, 2024). Original GitHub issue: https://github.com/muerrilla/sd-webui-detail-daemon/issues/12 *** Error executing callback cfg_denoiser_callback for /home/studio-lab-user/asd/extensions/sd-webui-detail-daemon/scripts/detail_daemon.py Traceback (most recent call last): File "/home/studio-lab-user/asd/modules/script_callbacks.py", line 333, in cfg_denoiser_callback c.callback(params) File "/home/studio-lab-user/asd/extensions/sd-webui-detail-daemon/scripts/detail_daemon.py", line 157, in denoiser_callback multiplier = self.schedule[idx] * .1 IndexError: index 49 is out of bounds for axis 0 with size 25
Author
Owner

@muerrilla commented on GitHub (Oct 10, 2024):

Need more context.

<!-- gh-comment-id:2404464562 --> @muerrilla commented on GitHub (Oct 10, 2024): Need more context.
Author
Owner

@Krek12 commented on GitHub (Oct 10, 2024):

Need more context.

I basically don't understand it myself, the extension seems to work but every step shows this is what you saw above.

<!-- gh-comment-id:2404537554 --> @Krek12 commented on GitHub (Oct 10, 2024): > Need more context. I basically don't understand it myself, the extension seems to work but every step shows this is what you saw above.
Author
Owner

@blepping commented on GitHub (Oct 24, 2024):

the logic for detecting 2 step samplers isn't working in this case. the extension makes a schedule with steps * 2 - 1 for those, not so coincidentally 25 * 2 - 1 is 49. you're probably using a sampler with a name it doesn't recognize as requiring that logic.

<!-- gh-comment-id:2434081124 --> @blepping commented on GitHub (Oct 24, 2024): the logic for detecting 2 step samplers isn't working in this case. the extension makes a schedule with `steps * 2 - 1` for those, not so coincidentally `25 * 2 - 1` is 49. you're probably using a sampler with a name it doesn't recognize as requiring that logic.
Author
Owner

@muerrilla commented on GitHub (Oct 24, 2024):

the logic for detecting 2 step samplers isn't working in this case. the extension makes a schedule with steps * 2 - 1 for those, not so coincidentally 25 * 2 - 1 is 49. you're probably using a sampler with a name it doesn't recognize as requiring that logic.

Half correct: The steps * 2 - 1 thing is done for a few samplers specified by name. So if the sampler name is not recognized it would not be triggered. So this can't be a case of sampler name not being recognized; hence the need for more context.

Oops, my bad. You're absolutely correct, I wasn't paying enough attention to which line is throwing the error. So, this might be caused by the 1.10.0 update. Haven't had time to update yet.

@Krek12 what sampler and webui version are you using?

<!-- gh-comment-id:2434512946 --> @muerrilla commented on GitHub (Oct 24, 2024): > the logic for detecting 2 step samplers isn't working in this case. the extension makes a schedule with `steps * 2 - 1` for those, not so coincidentally `25 * 2 - 1` is 49. you're probably using a sampler with a name it doesn't recognize as requiring that logic. ~~Half correct: The `steps * 2 - 1` thing is done for a few samplers specified by name. So if the sampler name is not recognized it would not be triggered. So this can't be a case of sampler name not being recognized; hence the need for more context.~~ Oops, my bad. You're absolutely correct, I wasn't paying enough attention to which line is throwing the error. So, this might be caused by the 1.10.0 update. Haven't had time to update yet. @Krek12 what sampler and webui version are you using?
Author
Owner

@blepping commented on GitHub (Oct 26, 2024):

@muerrilla not sure if it would be useful to you, but this is how i tried to deal with the problem: github.com/Jonseed/ComfyUI-Detail-Daemon@6d89e33265/detail_daemon_node.py (L199)

in the case where we want to call the model with a sigma in between two of the schedule sigmas, we interpolate between the two DD adjustments proportionately. for example, if the sigma is 10% of the way from the low sigma to the high sigma then you'd get a mix of 90% of the DD schedule at the low sigma and 10% from the high sigma. that's what it's supposed to do anyway, not sure it actually works correctly.

with that approach, you don't have to care about how many steps a sampler uses.

<!-- gh-comment-id:2439169764 --> @blepping commented on GitHub (Oct 26, 2024): @muerrilla not sure if it would be useful to you, but this is how i tried to deal with the problem: https://github.com/Jonseed/ComfyUI-Detail-Daemon/blob/6d89e3326563c3f6418c89ec62294b8169d85cfc/detail_daemon_node.py#L199 in the case where we want to call the model with a sigma in between two of the schedule sigmas, we interpolate between the two DD adjustments proportionately. for example, if the sigma is 10% of the way from the low sigma to the high sigma then you'd get a mix of 90% of the DD schedule at the low sigma and 10% from the high sigma. that's what it's supposed to do anyway, not sure it actually works correctly. with that approach, you don't have to care about how many steps a sampler uses.
Author
Owner

@muerrilla commented on GitHub (Oct 26, 2024):

@muerrilla not sure if it would be useful to you, but this is how i tried to deal with the problem:

Interesting approach, but this is both impossible to pull off feasibly in a1111 (as far as I understand) and also way more complex than my one-line workaround - which only requires regular manual maintenance 😅 to keep the list of 2-step samplers up-to-date.

Cheers.

<!-- gh-comment-id:2439699191 --> @muerrilla commented on GitHub (Oct 26, 2024): > @muerrilla not sure if it would be useful to you, but this is how i tried to deal with the problem: Interesting approach, but this is both impossible to pull off feasibly in a1111 (as far as I understand) and also way more complex than my one-line workaround - which only requires regular manual maintenance 😅 to keep the list of 2-step samplers up-to-date. Cheers.
Author
Owner

@Krek12 commented on GitHub (Oct 27, 2024):

the logic for detecting 2 step samplers isn't working in this case. the extension makes a schedule with steps * 2 - 1 for those, not so coincidentally 25 * 2 - 1 is 49. you're probably using a sampler with a name it doesn't recognize as requiring that logic.

Half correct: The steps * 2 - 1 thing is done for a few samplers specified by name. So if the sampler name is not recognized it would not be triggered. So this can't be a case of sampler name not being recognized; hence the need for more context.

Oops, my bad. You're absolutely correct, I wasn't paying enough attention to which line is throwing the error. So, this might be caused by the 1.10.0 update. Haven't had time to update yet.

@Krek12 what sampler and webui version are you using?

AUTOMATIC, sampler DYN

https://github.com/Koishi-Star/Euler-Smea-Dyn-Sampler

<!-- gh-comment-id:2439880337 --> @Krek12 commented on GitHub (Oct 27, 2024): > > the logic for detecting 2 step samplers isn't working in this case. the extension makes a schedule with `steps * 2 - 1` for those, not so coincidentally `25 * 2 - 1` is 49. you're probably using a sampler with a name it doesn't recognize as requiring that logic. > > ~Half correct: The `steps * 2 - 1` thing is done for a few samplers specified by name. So if the sampler name is not recognized it would not be triggered. So this can't be a case of sampler name not being recognized; hence the need for more context.~ > > Oops, my bad. You're absolutely correct, I wasn't paying enough attention to which line is throwing the error. So, this might be caused by the 1.10.0 update. Haven't had time to update yet. > > @Krek12 what sampler and webui version are you using? AUTOMATIC, sampler DYN https://github.com/Koishi-Star/Euler-Smea-Dyn-Sampler
Author
Owner

@Krek12 commented on GitHub (Mar 15, 2025):

@muerrilla interesing https://github.com/Jonseed/ComfyUI-Detail-Daemon.git

<!-- gh-comment-id:2726266472 --> @Krek12 commented on GitHub (Mar 15, 2025): @muerrilla interesing https://github.com/Jonseed/ComfyUI-Detail-Daemon.git
Author
Owner

@muerrilla commented on GitHub (Mar 15, 2025):

@muerrilla interesing https://github.com/Jonseed/ComfyUI-Detail-Daemon.git

@Krek12 Hey! Yup, but what exactly about it (besides what was discussed above)?

<!-- gh-comment-id:2726409813 --> @muerrilla commented on GitHub (Mar 15, 2025): > [@muerrilla](https://github.com/muerrilla) interesing https://github.com/Jonseed/ComfyUI-Detail-Daemon.git @Krek12 Hey! Yup, but what exactly about it (besides what was discussed above)?
Author
Owner

@muerrilla commented on GitHub (Mar 15, 2025):

AUTOMATIC, sampler DYN

@Krek12 Sorry for the super late response, I had missed this reply. I don't think I can add support for these custom samplers without rewriting the whole thing. So probably won't happen.

<!-- gh-comment-id:2726414055 --> @muerrilla commented on GitHub (Mar 15, 2025): > AUTOMATIC, sampler DYN @Krek12 Sorry for the super late response, I had missed this reply. I don't think I can add support for these custom samplers without rewriting the whole thing. So probably won't happen.
Author
Owner

@Krek12 commented on GitHub (Mar 15, 2025):

AUTOMATIC, sampler DYN

@Krek12 Sorry for the super late response, I had missed this reply. I don't think I can add support for these custom samplers without rewriting the whole thing. So probably won't happen.

Is it possible to learn a little instruction? How would it work? Through the code.

Well, more precisely, what is the reason for the error? maybe I'll try to fix it myself later.

<!-- gh-comment-id:2726499065 --> @Krek12 commented on GitHub (Mar 15, 2025): > > AUTOMATIC, sampler DYN > > [@Krek12](https://github.com/Krek12) Sorry for the super late response, I had missed this reply. I don't think I can add support for these custom samplers without rewriting the whole thing. So probably won't happen. Is it possible to learn a little instruction? How would it work? Through the code. Well, more precisely, what is the reason for the error? maybe I'll try to fix it myself later.
Author
Owner

@Krek12 commented on GitHub (Mar 15, 2025):

An idea, by the way. Why don't you add a button to the extension that enables the operation of the detail daemon in hires-fix or turns it off.

Example to this:
https://github.com/Bing-su/adetailer/compare/main...MisterChief95:adetailer:main

<!-- gh-comment-id:2726503823 --> @Krek12 commented on GitHub (Mar 15, 2025): An idea, by the way. Why don't you add a button to the extension that enables the operation of the detail daemon in hires-fix or turns it off. Example to this: https://github.com/Bing-su/adetailer/compare/main...MisterChief95:adetailer:main
Author
Owner

@muerrilla commented on GitHub (Mar 15, 2025):

Well, more precisely, what is the reason for the error? maybe I'll try to fix it myself later.

DD creates a schedule with a value for each step. The number of steps you set in the generation parameters are not necessarily the actual number of times the sampling function is run during generation. This depends on the sampler. For example second order samplers (e.g. Heun) do 2x the number of steps you set. DD handles this by checking the sampler name and when it's a second order sampler, it makes the schedule twice as long. Smea Dyn samplers do some extra steps, so they are neither x steps nor 2x steps but x + c steps or something. DD assumes they are normal samplers (since the sampler name is not one of the second order samplers) so it creates a schedule with the wrong number of steps, hence the error. Hope this helps.

<!-- gh-comment-id:2726908663 --> @muerrilla commented on GitHub (Mar 15, 2025): > Well, more precisely, what is the reason for the error? maybe I'll try to fix it myself later. DD creates a schedule with a value for each step. The number of steps you set in the generation parameters are not necessarily the actual number of times the sampling function is run during generation. This depends on the sampler. For example second order samplers (e.g. Heun) do 2x the number of steps you set. DD handles this by checking the sampler name and when it's a second order sampler, it makes the schedule twice as long. Smea Dyn samplers do some extra steps, so they are neither x steps nor 2x steps but x + c steps or something. DD assumes they are normal samplers (since the sampler name is not one of the second order samplers) so it creates a schedule with the wrong number of steps, hence the error. Hope this helps.
Author
Owner

@muerrilla commented on GitHub (Mar 15, 2025):

An idea, by the way. Why don't you add a button to the extension that enables the operation of the detail daemon in hires-fix or turns it off.

That one I've already done (plus some other features) but I need to do some code cleanup before I can release it. So maybe in like a month or so, when I have the free time to do that.

<!-- gh-comment-id:2726910473 --> @muerrilla commented on GitHub (Mar 15, 2025): > An idea, by the way. Why don't you add a button to the extension that enables the operation of the detail daemon in hires-fix or turns it off. > That one I've already done (plus some other features) but I need to do some code cleanup before I can release it. So maybe in like a month or so, when I have the free time to do that.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
muerrilla/sd-webui-detail-daemon#8
No description provided.