(
out_channels: int,
prev_output_channel: int,
ctrl_skip_channels: List[int],
)
| 229 | |
| 230 | |
| 231 | def get_up_block_adapter( |
| 232 | out_channels: int, |
| 233 | prev_output_channel: int, |
| 234 | ctrl_skip_channels: List[int], |
| 235 | ): |
| 236 | ctrl_to_base = [] |
| 237 | num_layers = 3 # only support sd + sdxl |
| 238 | for i in range(num_layers): |
| 239 | resnet_in_channels = prev_output_channel if i == 0 else out_channels |
| 240 | ctrl_to_base.append(make_zero_conv(ctrl_skip_channels[i], resnet_in_channels)) |
| 241 | |
| 242 | return UpBlockControlNetXSAdapter(ctrl_to_base=nn.ModuleList(ctrl_to_base)) |
| 243 | |
| 244 | |
| 245 | class ControlNetXSAdapter(ModelMixin, ConfigMixin): |
no test coverage detected