Open igorleo10 opened 1 year ago
I got the same question regarding the lineart and linart_anime preprocessors. I'm curious about why we need to invert the black and white colors in the last step, where the original controlnet did not do this invert process (or if it was done somewhere else, could you please clarify this for me?)
detected_map = 255 - detected_map
In the original sources, the invert happens here:
https://github.com/lllyasviel/ControlNet-v1-1-nightly/blob/main/gradio_lineart.py#L48
The controlnet_aux processor output can be directly used by the model. In the original implementation, most of the code is in the annotator but there was often minor post-processing done in the example.
I assume the original question is referring to the "invert (from white bg & black line)" processor that exists in the A111 extension. There's no implementation here but it would be trivial for someone to add.
我对 Lineart 和 linart_anime 预处理器有同样的问题。我很好奇为什么我们需要在最后一步中反转黑白颜色,而原始的控制网络没有执行此反转过程(或者如果它是在其他地方完成的,您能为我澄清一下吗?)
detected_map = 255 - detected_map
In A111, the "invert" operation is applied to images that do not go through controlnet_aux, and it involves reversing white background to black lines, turning them into black background with white lines. Other preprocessing modes are handled within controlnet_aux. The input for controlnet needs to be in black background with white lines.
Can you please link to a code line or something? I don't know what you mean with this title