Skip to content

Commit 04ab2fa

Browse files
Sen-souAcly
authored andcommitted
Added back pose and depth
1 parent 30c8e59 commit 04ab2fa

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

ai_diffusion/backend/resources.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ def can_substitute_universal(self, arch: Arch):
377377
return self in [
378378
ControlMode.scribble,
379379
ControlMode.line_art,
380+
ControlMode.depth,
381+
ControlMode.pose,
380382
ControlMode.blur,
381383
]
382384
if arch.is_sdxl_like or arch is Arch.qwen:
@@ -760,11 +762,13 @@ def is_required(kind: ResourceKind, arch: Arch, identifier: ControlMode | Upscal
760762
resource_id(ResourceKind.controlnet, Arch.sd15, ControlMode.depth): ["control_sd15_depth_anything", "control_v11f1p_sd15_depth", "control_lora_rank128_v11f1p_sd15_depth"],
761763
resource_id(ResourceKind.controlnet, Arch.sdxl, ControlMode.depth): ["xinsirdepth", "depth-sdxl", "control-lora-depth-rank", "sai_xl_depth_"],
762764
resource_id(ResourceKind.controlnet, Arch.flux, ControlMode.depth): ["flux-depth"],
765+
resource_id(ResourceKind.controlnet, Arch.anima, ControlMode.depth): ["anima*lllite*depth", "lllite*anima*depth", "depth*anima*lllite", "depth*lllite*anima"],
763766
resource_id(ResourceKind.controlnet, Arch.illu, ControlMode.depth): ["noob-sdxl-controlnet-depth", "noobaixlcontrolnet_epsdepth"],
764767
resource_id(ResourceKind.controlnet, Arch.sd15, ControlMode.normal): ["control_v11p_sd15_normalbae", "control_lora_rank128_v11p_sd15_normalbae"],
765768
resource_id(ResourceKind.controlnet, Arch.illu, ControlMode.normal): ["noob-sdxl-controlnet-normal", "noobaixlcontrolnet_epsnormal"],
766769
resource_id(ResourceKind.controlnet, Arch.sd15, ControlMode.pose): ["control_v11p_sd15_openpose", "control_lora_rank128_v11p_sd15_openpose"],
767770
resource_id(ResourceKind.controlnet, Arch.sdxl, ControlMode.pose): ["xinsiropenpose", "openpose-sdxl", "control-lora-openposexl2-rank", "thibaud_xl_openpose"],
771+
resource_id(ResourceKind.controlnet, Arch.anima, ControlMode.pose): ["anima*lllite*pose", "anima*lllite*openpose", "lllite*anima*pose", "lllite*anima*openpose", "pose*anima*lllite", "openpose*anima*lllite", "pose*lllite*anima", "openpose*lllite*anima"],
768772
resource_id(ResourceKind.controlnet, Arch.illu, ControlMode.pose): ["noob-sdxl-controlnet-openpose", "noobaixlcontrolnet_openpose"],
769773
resource_id(ResourceKind.controlnet, Arch.sd15, ControlMode.segmentation): ["control_v11p_sd15_seg", "control_lora_rank128_v11p_sd15_seg"],
770774
resource_id(ResourceKind.controlnet, Arch.sdxl, ControlMode.segmentation): ["sdxl_segmentation_ade20k_controlnet"],

ai_diffusion/backend/workflow.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,9 +981,7 @@ def detect_inpaint(
981981
)
982982
elif arch.is_sdxl_like:
983983
result.use_inpaint_model = strength > 0.8
984-
elif arch in (Arch.flux, Arch.zimage):
985-
result.use_inpaint_model = strength == 1.0
986-
elif arch is Arch.anima:
984+
elif arch in (Arch.flux, Arch.zimage, Arch.anima):
987985
result.use_inpaint_model = strength == 1.0
988986
elif arch.is_edit:
989987
result.mode = InpaintMode.custom

tests/test_workflow.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ def test_inpaint_params():
230230
def test_anima_lllite_control_workflow():
231231
w = ComfyWorkflow()
232232
models = ClientModels()
233-
models.resources[
234-
resource_id(ResourceKind.controlnet, Arch.anima, ControlMode.blur)
235-
] = "anima-lllite-blur.safetensors"
233+
models.resources[resource_id(ResourceKind.controlnet, Arch.anima, ControlMode.universal)] = (
234+
"anima-lllite-anytest.safetensors"
235+
)
236236
cond = workflow.ConditioningOutput(workflow.Output(2, 0), workflow.Output(3, 0))
237237
control = workflow.Control(
238238
ControlMode.blur,
@@ -253,6 +253,8 @@ def test_anima_lllite_control_workflow():
253253

254254
assert result == cond
255255
assert w.root[str(model.node)]["class_type"] == "ETN_control_apply"
256+
assert w.root[str(model.node)]["inputs"]["control_net"] == [str(model.node - 1), 1]
257+
assert w.root[str(model.node - 1)]["inputs"]["weights"] == "anima-lllite-anytest.safetensors"
256258
assert any(n["class_type"] == "ETN_control_load" for n in w.root.values())
257259
assert not any(n["class_type"] == "ControlNetLoader" for n in w.root.values())
258260

0 commit comments

Comments
 (0)