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