Image Generation: Add tool message visibility toggle
| @@ -319,6 +319,7 @@ const defaultSettings = { | |||
| 319 | wand_visible: false, | 319 | wand_visible: false, |
| 320 | command_visible: false, | 320 | command_visible: false, |
| 321 | interactive_visible: false, | 321 | interactive_visible: false, |
| 322 | tool_visible: false, | ||
| 322 | 323 | ||
| 323 | // Stability AI settings | 324 | // Stability AI settings |
| 324 | stability_style_preset: 'anime', | 325 | stability_style_preset: 'anime', |
| @@ -488,6 +489,7 @@ async function loadSettings() { | |||
| 488 | $('#sd_wand_visible').prop('checked', extension_settings.sd.wand_visible); | 489 | $('#sd_wand_visible').prop('checked', extension_settings.sd.wand_visible); |
| 489 | $('#sd_command_visible').prop('checked', extension_settings.sd.command_visible); | 490 | $('#sd_command_visible').prop('checked', extension_settings.sd.command_visible); |
| 490 | $('#sd_interactive_visible').prop('checked', extension_settings.sd.interactive_visible); | 491 | $('#sd_interactive_visible').prop('checked', extension_settings.sd.interactive_visible); |
| 492 | $('#sd_tool_visible').prop('checked', extension_settings.sd.tool_visible); | ||
| 491 | $('#sd_stability_style_preset').val(extension_settings.sd.stability_style_preset); | 493 | $('#sd_stability_style_preset').val(extension_settings.sd.stability_style_preset); |
| 492 | $('#sd_huggingface_model_id').val(extension_settings.sd.huggingface_model_id); | 494 | $('#sd_huggingface_model_id').val(extension_settings.sd.huggingface_model_id); |
| 493 | $('#sd_function_tool').prop('checked', extension_settings.sd.function_tool); | 495 | $('#sd_function_tool').prop('checked', extension_settings.sd.function_tool); |
| @@ -844,6 +846,11 @@ function onInteractiveVisibleInput() { | |||
| 844 | saveSettingsDebounced(); | 846 | saveSettingsDebounced(); |
| 845 | } | 847 | } |
| 846 | 848 | ||
| 849 | function onToolVisibleInput() { | ||
| 850 | extension_settings.sd.tool_visible = !!$('#sd_tool_visible').prop('checked'); | ||
| 851 | saveSettingsDebounced(); | ||
| 852 | } | ||
| 853 | |||
| 847 | function onClipSkipInput() { | 854 | function onClipSkipInput() { |
| 848 | extension_settings.sd.clip_skip = Number($('#sd_clip_skip').val()); | 855 | extension_settings.sd.clip_skip = Number($('#sd_clip_skip').val()); |
| 849 | $('#sd_clip_skip_value').val(extension_settings.sd.clip_skip); | 856 | $('#sd_clip_skip_value').val(extension_settings.sd.clip_skip); |
| @@ -3670,6 +3677,8 @@ function getVisibilityByInitiator(initiator) { | |||
| 3670 | return !!extension_settings.sd.wand_visible; | 3677 | return !!extension_settings.sd.wand_visible; |
| 3671 | case initiators.command: | 3678 | case initiators.command: |
| 3672 | return !!extension_settings.sd.command_visible; | 3679 | return !!extension_settings.sd.command_visible; |
| 3680 | case initiators.tool: | ||
| 3681 | return !!extension_settings.sd.tool_visible; | ||
| 3673 | default: | 3682 | default: |
| 3674 | return false; | 3683 | return false; |
| 3675 | } | 3684 | } |
| @@ -4417,6 +4426,7 @@ jQuery(async () => { | |||
| 4417 | $('#sd_wand_visible').on('input', onWandVisibleInput); | 4426 | $('#sd_wand_visible').on('input', onWandVisibleInput); |
| 4418 | $('#sd_command_visible').on('input', onCommandVisibleInput); | 4427 | $('#sd_command_visible').on('input', onCommandVisibleInput); |
| 4419 | $('#sd_interactive_visible').on('input', onInteractiveVisibleInput); | 4428 | $('#sd_interactive_visible').on('input', onInteractiveVisibleInput); |
| 4429 | $('#sd_tool_visible').on('input', onToolVisibleInput); | ||
| 4420 | $('#sd_swap_dimensions').on('click', onSwapDimensionsClick); | 4430 | $('#sd_swap_dimensions').on('click', onSwapDimensionsClick); |
| 4421 | $('#sd_stability_key').on('click', onStabilityKeyClick); | 4431 | $('#sd_stability_key').on('click', onStabilityKeyClick); |
| 4422 | $('#sd_stability_style_preset').on('change', onStabilityStylePresetChange); | 4432 | $('#sd_stability_style_preset').on('change', onStabilityStylePresetChange); |
| @@ -459,25 +459,32 @@ | |||
| 459 | <div class="flex-container flexFlowColumn marginTopBot5 flexGap10"> | 459 | <div class="flex-container flexFlowColumn marginTopBot5 flexGap10"> |
| 460 | <label for="sd_wand_visible" class="checkbox_label"> | 460 | <label for="sd_wand_visible" class="checkbox_label"> |
| 461 | <span class="flex1 flex-container alignItemsCenter"> | 461 | <span class="flex1 flex-container alignItemsCenter"> |
| 462 | <i class="fa-solid fa-wand-magic-sparkles"></i> | 462 | <i class="fa-solid fa-wand-magic-sparkles fa-fw"></i> |
| 463 | <span data-i18n="Extensions Menu">Extensions Menu</span> | 463 | <span data-i18n="Extensions Menu">Extensions Menu</span> |
| 464 | </span> | 464 | </span> |
| 465 | <input id="sd_wand_visible" type="checkbox" /> | 465 | <input id="sd_wand_visible" type="checkbox" /> |
| 466 | </label> | 466 | </label> |
| 467 | <label for="sd_command_visible" class="checkbox_label"> | 467 | <label for="sd_command_visible" class="checkbox_label"> |
| 468 | <span class="flex1 flex-container alignItemsCenter"> | 468 | <span class="flex1 flex-container alignItemsCenter"> |
| 469 | <i class="fa-solid fa-terminal"></i> | 469 | <i class="fa-solid fa-terminal fa-fw"></i> |
| 470 | <span data-i18n="Slash Command">Slash Command</span> | 470 | <span data-i18n="Slash Command">Slash Command</span> |
| 471 | </span> | 471 | </span> |
| 472 | <input id="sd_command_visible" type="checkbox" /> | 472 | <input id="sd_command_visible" type="checkbox" /> |
| 473 | </label> | 473 | </label> |
| 474 | <label for="sd_interactive_visible" class="checkbox_label"> | 474 | <label for="sd_interactive_visible" class="checkbox_label"> |
| 475 | <span class="flex1 flex-container alignItemsCenter"> | 475 | <span class="flex1 flex-container alignItemsCenter"> |
| 476 | <i class="fa-solid fa-message"></i> | 476 | <i class="fa-solid fa-message fa-fw"></i> |
| 477 | <span data-i18n="Interactive Mode">Interactive Mode</span> | 477 | <span data-i18n="Interactive Mode">Interactive Mode</span> |
| 478 | </span> | 478 | </span> |
| 479 | <input id="sd_interactive_visible" type="checkbox" /> | 479 | <input id="sd_interactive_visible" type="checkbox" /> |
| 480 | </label> | 480 | </label> |
| 481 | <label for="sd_tool_visible" class="checkbox_label"> | ||
| 482 | <span class="flex1 flex-container alignItemsCenter"> | ||
| 483 | <i class="fa-solid fa-code fa-fw"></i> | ||
| 484 | <span data-i18n="Function Tool">Function Tool</span> | ||
| 485 | </span> | ||
| 486 | <input id="sd_tool_visible" type="checkbox" /> | ||
| 487 | </label> | ||
| 481 | </div> | 488 | </div> |
| 482 | </div> | 489 | </div> |
| 483 | </div> | 490 | </div> |