Skip to content

Commit

Permalink
Fix controlnet with precessor set to none
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyma committed Sep 15, 2023
1 parent 81cc9ab commit e71b3e3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/ex_sd/comfy_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,6 @@ defmodule ExSd.ComfyClient do
},
class_type: "Base64ImageInput"
},
# FIXME: handle none
"cn#{index}_preprocessor": controlnet_preprocessor(index, %{}, entry.module),
"cn#{index}_controlnet_loader": %{
inputs: %{
control_net_name: entry.model
Expand Down Expand Up @@ -1112,13 +1110,25 @@ defmodule ExSd.ComfyClient do
0
],
image: [
"cn#{index}_preprocessor",
if(
entry.module == "none",
do: "cn#{index}_image",
else: "cn#{index}_preprocessor"
),
0
]
},
class_type: "ControlNetApplyAdvanced"
}
})
|> Map.merge(
if(entry.module == "none",
do: %{},
else: %{
"cn#{index}_preprocessor": controlnet_preprocessor(index, %{}, entry.module)
}
)
)
end)
end

Expand Down

0 comments on commit e71b3e3

Please sign in to comment.