Skip to content

Commit

Permalink
enable hires fix in all comfyui modes
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdullahAlfaraj committed Nov 19, 2023
1 parent 3fd3a4f commit 8d73846
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
12 changes: 4 additions & 8 deletions typescripts/sd_tab/sd_tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import {
onHeightSliderInput,
heightSliderOnChangeEventHandler,
loadPresetSettings,

isHiResMode,
} from './util'
import { general } from '../util/oldSystem'
import { requestSwapModel, setInpaintMaskWeight } from '../util/ts/sdapi'
Expand Down Expand Up @@ -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) => {
Expand All @@ -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',
}}
Expand Down
14 changes: 14 additions & 0 deletions typescripts/sd_tab/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8d73846

Please sign in to comment.