From 8d4d409cd6a01e71b7431c1a152f33dd13b26940 Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Tue, 24 Jan 2023 01:47:48 -0800 Subject: [PATCH] Add 'embed' and 'none' to metadata saving options *** Please merge https://github.com/easydiffusion/sdkit/pull/9 before merging this one. *** This is the ED client part of metadata embedding. It adds 'embed' and 'none' options to the metadata setting and makes none the default (if never set before) because (1) it feels weird to create metadata files by default and (2) embedding by default could cause be problematic if users don't realize it's happening. Also fixes the disabling of the dropdown in the settings when Save images to disk is toggled off. --- ui/media/js/main.js | 1 + ui/media/js/parameters.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index e515787b..99ca0b40 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1164,6 +1164,7 @@ function onDimensionChange() { } diskPathField.disabled = !saveToDiskField.checked +metadataOutputFormatField.disabled = !saveToDiskField.checked upscaleModelField.disabled = !useUpscalingField.checked upscaleAmountField.disabled = !useUpscalingField.checked diff --git a/ui/media/js/parameters.js b/ui/media/js/parameters.js index 522706af..b0d93522 100644 --- a/ui/media/js/parameters.js +++ b/ui/media/js/parameters.js @@ -58,8 +58,12 @@ var PARAMETERS = [ type: ParameterType.select, label: "Metadata format", note: "will be saved to disk in this format", - default: "txt", + default: "none", options: [ + { + value: "none", + label: "none" + }, { value: "txt", label: "txt" @@ -67,6 +71,10 @@ var PARAMETERS = [ { value: "json", label: "json" + }, + { + value: "embed", + label: "embed" } ], }, @@ -226,6 +234,7 @@ let autoPickGPUsField = document.querySelector('#auto_pick_gpus') let useGPUsField = document.querySelector('#use_gpus') let saveToDiskField = document.querySelector('#save_to_disk') let diskPathField = document.querySelector('#diskPath') +let metadataOutputFormatField = document.querySelector('#metadata_output_format') let listenToNetworkField = document.querySelector("#listen_to_network") let listenPortField = document.querySelector("#listen_port") let useBetaChannelField = document.querySelector("#use_beta_channel") @@ -279,6 +288,7 @@ async function getAppConfig() { saveToDiskField.addEventListener('change', function(e) { diskPathField.disabled = !this.checked + metadataOutputFormatField.disabled = !this.checked }) function getCurrentRenderDeviceSelection() {