adieyal / sd-dynamic-prompts

A custom script for AUTOMATIC1111/stable-diffusion-webui to implement a tiny template language for random prompt generation
MIT License
2.02k stars 261 forks source link

Extension load count improvement needed #720

Open LankyPoet opened 8 months ago

LankyPoet commented 8 months ago

I am using SD.Next with the dynamic prompts extension. In the new dev branch, they have implemented better logic to load extensions in parallel. However this causes a strange issue with Dynamic Prompts as it then loads in two "Wildcards Manager" tabs at the top.

Since it is loading in parallel, a second copy starts loading before first finished, so it thinks it is the first copy.

In sd_dynmic_prompts/dynamic_prompting.py , instead of:


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

consider changing to something like:


        if loaded_count > 0:
            return
        loaded_count += 1

Thank you!

gohan2091 commented 8 months ago

I am getting the same: two "Wildcards Manager" tabs at the top.

Screenshot 2024-02-02 201311

slimeqslimedog commented 2 months ago

I'm also having this issue with SD.Next, but according to the comments the suggested fix might break the extension for the "Reload UI" button.

Edit: Also, to clarify, the fix as written needs to be put after the self._prompt_writer and self._wildcard_manager initializations in that file.