| 54 | controlnet_path = folder_paths.get_full_path("controlnet", name) |
| 55 | controlnet = load_controlnetplusplus(controlnet_path) |
| 56 | controlnet.single_control_type = control_type |
| 57 | controlnet.verify_control_type(name) |
| 58 | return io.NodeOutput(controlnet,) |
| 59 | |
| 60 | class PlusPlusInputNode(io.ComfyNode): |
| 61 | @classmethod |
| 62 | def define_schema(cls) -> io.Schema: |
| 63 | return io.Schema( |
| 64 | node_id='ACN_ControlNet++InputNode', |
| 65 | display_name='ControlNet++ Input 🛂🅐🅒🅝', |
| 66 | category='Adv-ControlNet 🛂🅐🅒🅝/ControlNet++', |
| 67 | inputs=[ |
| 68 | io.Image.Input('image'), |
| 69 | io.Combo.Input('control_type', options=['openpose', 'depth', 'hed/pidi/scribble/ted', 'canny/lineart/mlsd', 'normal', 'segment', 'tile', 'inpaint/outpaint']), |
| 70 | io.Custom('PLUS_INPUT').Input('prev_plus_input', optional=True) |
| 71 | ], |
| 72 | outputs=[ |
| 73 | io.Custom('PLUS_INPUT').Output('PLUS_INPUT', is_output_list=False) |
| 74 | ] |
| 75 | ) |
| 76 | |
| 77 | |
| 78 | @classmethod |
| 79 | def execute(cls, image: Tensor, control_type: str, strength=1.0, prev_plus_input: PlusPlusInputGroup=None): |
| 80 | if prev_plus_input is None: |
| 81 | prev_plus_input = PlusPlusInputGroup() |
| 82 | prev_plus_input = prev_plus_input.clone() |
| 83 | |
| 84 | if math.isclose(strength, 0.0): |
| 85 | strength = 0.0000001 |
| 86 | pp_input = PlusPlusInput(image, control_type, strength) |
| 87 | prev_plus_input.add(pp_input) |
| 88 | |
| 89 | return io.NodeOutput(prev_plus_input,) |
nothing calls this directly
no outgoing calls
no test coverage detected