ljleb / sd-webui-neutral-prompt

Collision-free AND keywords for a1111 webui!
MIT License
187 stars 13 forks source link

JS error when additional quicksettings are added #64

Closed obfuscode closed 5 months ago

obfuscode commented 7 months ago

Issue: It looks like Neutral Prompt isn't getting the correct selector for the txt2img or img2img Prompt field when there is anything additional added to the UI that comes before the txt2img prompt field. This includes additional Quicksettings or additional primary tabs added by other extensions.

Reproducible: Yes

Details: I did a new install of Automatic1111 through Pinokio with no additional extensions and added sd_vae and pad_cond_uncond to the default sd_model_checkpoint in the "Quicksettings list" setting.

I removed the quicksettings and it functioned again so I re-added my extensions that added additional primary section tabs and it broke once more.

Hypothesis: However you're calculating the id you're passing to the instance_map[] is being thrown off by the addition of any parent or parent sibling elements.

Screenshot 2024-01-31 224919

Blocks.svelte:360 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'props')
    at Blocks.svelte:360:50
    at Array.map (<anonymous>)
    at we (Blocks.svelte:360:21)
let payload = {
    fn_index: dep_index,
    data: dep.inputs.map((id) => instance_map[id].props.value), // Error here
    event_data: dep.collects_event_data ? event_data : null
};
ljleb commented 7 months ago

Is this a problem even after pressing F5? Usually whenever the ui has to be recreated in gradio, it's a good idea to refresh the page. Until the UI is recreated exactly the same, some component indices will be off by some value and it will break down on practically any interaction.

I am unable to reproduce this, if the UI is recreated and the page fully reloaded. The code has no javascript so this seems a bit odd to me.