Spaces:
Runtime error
Runtime error
Download javascript/prompt_generator_tooltips.js from svjack/Next-Diffusion-Prompt-Generator: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/svjack/Next-Diffusion-Prompt-Generator/resolve/main/javascript/prompt_generator_tooltips.js
- Command line
-
hf download hf://spaces/svjack/Next-Diffusion-Prompt-Generator/javascript/prompt_generator_tooltips.js
-
curl -L -o prompt_generator_tooltips.js https://huggingface.co/spaces/svjack/Next-Diffusion-Prompt-Generator/resolve/main/javascript/prompt_generator_tooltips.js
1.25 kB
| //Basically copied and adapted from AUTOMATIC1111 implementation of the main UI | |
| // mouseover tooltips for various UI elements in the form of "UI element label"="Tooltip text". | |
| prompt_generator_titles = { | |
| "Category": "Refers to the primary category for the prompt output", | |
| "Style": "Determines the main style for the prompt output", | |
| "Lightning": "Represents the lightning strategy used for the prompt output", | |
| "Lens": "Specifies the lens parameter used for the prompt output", | |
| "Include Negative Prompt": "Checked: Default negative prompt sent. Unchecked: Empty string sent." | |
| } | |
| onUiUpdate(function () { | |
| gradioApp().querySelectorAll('span, button, select, p').forEach(function (span) { | |
| tooltip = prompt_generator_titles[span.textContent]; | |
| if (!tooltip) { | |
| tooltip = prompt_generator_titles[span.value]; | |
| } | |
| if (!tooltip) { | |
| for (const c of span.classList) { | |
| if (c in prompt_generator_titles) { | |
| tooltip = prompt_generator_titles[c]; | |
| break; | |
| } | |
| } | |
| } | |
| if (tooltip) { | |
| span.title = tooltip; | |
| } | |
| }) | |
| gradioApp().querySelectorAll('select').forEach(function (select) { | |
| if (select.onchange != null) return; | |
| select.onchange = function () { | |
| select.title = prompt_generator_titles[select.value] || ""; | |
| } | |
| }) | |
| }) | |