diff --git a/typescripts/sd_tab/sd_tab.tsx b/typescripts/sd_tab/sd_tab.tsx index 7e3acba5..9257763d 100644 --- a/typescripts/sd_tab/sd_tab.tsx +++ b/typescripts/sd_tab/sd_tab.tsx @@ -38,6 +38,8 @@ import { onHeightSliderInput, heightSliderOnChangeEventHandler, loadPresetSettings, + + isHiResMode, } from './util' import { general } from '../util/oldSystem' import { requestSwapModel, setInpaintMaskWeight } from '../util/ts/sdapi' @@ -1103,11 +1105,7 @@ class SDTab extends React.Component<{}> { class="checkbox" id="chHiResFixs" style={{ - display: [ScriptMode.Txt2Img].includes( - store.data.rb_mode - ) - ? 'flex' - : 'none', + display: isHiResMode() ? 'flex' : 'none', }} checked={store.data.enable_hr} onClick={(evt: any) => { @@ -1131,9 +1129,7 @@ class SDTab extends React.Component<{}> { id="HiResDiv" style={{ display: - [ScriptMode.Txt2Img].includes( - store.data.rb_mode - ) && store.data.enable_hr + isHiResMode() && store.data.enable_hr ? void 0 : 'none', }} diff --git a/typescripts/sd_tab/util.ts b/typescripts/sd_tab/util.ts index 2bdd118b..b5b3ce39 100644 --- a/typescripts/sd_tab/util.ts +++ b/typescripts/sd_tab/util.ts @@ -714,6 +714,20 @@ export function loadPresetSettings(preset: any) { // io_ts.presetToStore(preset?.controlnet_tab_preset, store) } } +export function isHiResMode() { + let is_hi_res_mode = false + if (settings_tab_ts.store.data.selected_backend === 'Automatic1111') { + is_hi_res_mode = [ScriptMode.Txt2Img].includes(store.data.rb_mode) + } else if (settings_tab_ts.store.data.selected_backend === 'ComfyUI') { + is_hi_res_mode = [ + ScriptMode.Txt2Img, + ScriptMode.Img2Img, + ScriptMode.Inpaint, + ScriptMode.Outpaint, + ].includes(store.data.rb_mode) + } + return is_hi_res_mode +} export default { store: store,