sd-dynamic-prompts icon indicating copy to clipboard operation
sd-dynamic-prompts copied to clipboard

Double wildcard manager tab bug when installed with replacer extension

Open rltgjqmcpgjadyd opened this issue 1 year ago • 7 comments

스크린샷 2024-04-18 114407

webui 1.9.0

Enable only two extensions sd-dynamic-prompts & sd-webui-replacer

I've confirmed this doesn't happen with other extensions

I don't know which extension is the problem

See also https://github.com/adieyal/sd-dynamic-prompts/pull/481

rltgjqmcpgjadyd avatar Apr 18 '24 02:04 rltgjqmcpgjadyd

I can't see why my extension can affects on other extension's on tab callback. Also I don't see it among your tabs in the screenshot

light-and-ray avatar Apr 18 '24 04:04 light-and-ray

I can't see why my extension can affects on other extension's on tab callback. Also I don't see it among your tabs in the screenshot

you don't see the replacer tab because I don't have enabled segment-anything

스크린샷 2024-04-18 140129

Enable segment-anything like this and you'll see the tab

rltgjqmcpgjadyd avatar Apr 18 '24 05:04 rltgjqmcpgjadyd

I add my second tab here https://github.com/light-and-ray/sd-webui-replacer/blob/375e20260e2b9fbdba21a816679f65af07e3f0ec/scripts/replacer_main_ui.py#L37 but it's on dedicated page. Maybe this extension has a kind of onAfterComponent callbacks, which listens all new tabs. I can reproduce this error, but I don't have any other ideas

light-and-ray avatar Apr 18 '24 05:04 light-and-ray

I can confirm this bug for https://github.com/vladmandic/automatic - shows the tab twice.

image

Tillerz avatar Apr 24 '24 11:04 Tillerz

See a fix suggestion by vladmantic here: https://discord.com/channels/1101998836328697867/1199450263556198492/1202268975288045578

sd_dynmic_prompts/dynamic_prompting.py

        global loaded_count
        loaded_count += 1
        if loaded_count % 2 == 0:
            return

this code needs to be removed and do things right also, we have THREE tabs, txt2img/img2img/control, so this will ALWAYS load two copies as only one is skipped. at the very least, do this:

        if loaded_count > 0:
            return
        loaded_count += 1

it still uses silly hack, but at least math is not wrong

Tillerz avatar Apr 24 '24 11:04 Tillerz

if loaded_count % 2 == 0:

Nice vladmandic style 👍 What happens if the bug happens 3 or more times...

The idea is okay. But better to make global bool variable, set it on initialization, and reset it on unload callback

light-and-ray avatar Apr 24 '24 14:04 light-and-ray

Whatever, someone just fix it. :P

Tillerz avatar May 12 '24 15:05 Tillerz