Skip to content

Commit

Permalink
Allow empty inpainting controlnet init image
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdullahAlfaraj committed Oct 27, 2023
1 parent 321d448 commit 91e0830
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions typescripts/session/modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,15 @@ export class Txt2ImgMode extends Mode {
}
control_networks[index] = true

const is_inpaint_model: boolean =
control_net_settings['controlnet_units'][index][
'module'
].includes('inpaint')
if (
!control_net_settings['controlnet_units'][index]['input_image']
!control_net_settings['controlnet_units'][index][
'input_image'
] &&
!is_inpaint_model
) {
//@ts-ignore
app.showAlert('you need to add a valid ControlNet input image')
Expand Down Expand Up @@ -304,8 +311,17 @@ export class Img2ImgMode extends Mode {
continue
}
control_networks[index] = true

const is_inpaint_model: boolean =
control_net_settings['controlnet_units'][index][
'module'
].includes('inpaint')

if (
!control_net_settings['controlnet_units'][index]['input_image']
!control_net_settings['controlnet_units'][index][
'input_image'
] &&
!is_inpaint_model
) {
//@ts-ignore
app.showAlert('you need to add a valid ControlNet input image')
Expand Down

0 comments on commit 91e0830

Please sign in to comment.