Closed huchenlei closed 5 months ago
img2img input can be used by other extensions such as ControlNet
Hence why doesn't it make more sense when the img2img
input is your subject?
What use is sending a black and white gradient to ControlNet
anyway?
img2img input can be used by other extensions such as ControlNet
Hence why doesn't it make more sense when the
img2img
input is your subject?What use is sending a black and white gradient to
ControlNet
anyway?
If you make people use img2img input as fg input, they might think the fg image will be passed to ControlNet when "use independent control" checkbox is not checked. What they really need to do is check that checkbox and upload fg image again to ControlNet unit for correct control image.
I think swapping the images is just too risky. It also introduces more mental effort when the user compares the ComfyUI impl and Forge/A1111 impl.
the fg image will be passed to ControlNet when "use independent control" checkbox is not checked
Yes. That's my intention. The img2img
input, is, well, the input. The lightmaps is used by the Extension, so it belongs to the Extension instead.
When you generate a portrait in txt2img
, and click Send to img2img
, where does it send the image to? That's right, the img2img
input.
Again, this just makes more sense imho
And I revert your revert again in my own fork
swapping the images is just too risky
Honestly, the only reason why I did the swapping approach is cause I don't know how the original model works. So I just swap them early to continue with your implementaion. If IC Light can take the images directly, then swapping wouldn't be needed.
swapping the images is just too risky
Honestly, the only reason why I did the swapping approach is cause I don't know how the original model works. So I just swap them early to continue with your implementaion. If IC Light can take the images directly, then swapping wouldn't be needed.
I think the txt2img/img2img design is the core problem. A1111 does not allow you launch img2img task without an input image, so the lightmap upload cannot be in the extension accordion.
In ComfyUI it is much more clear that txt2img is just setting initial latent as random noise.
the fg image will be passed to ControlNet when "use independent control" checkbox is not checked
Yes. That's my intention. The
img2img
input, is, well, the input. The lightmaps is used by the Extension, so it belongs to the Extension instead.When you generate a portrait in
txt2img
, and clickSend to img2img
, where does it send the image to? That's right, theimg2img
input.Again, this just makes more sense imho
~And I revert your revert again in my own fork~
How about we make it a checkbox in the settings so that users can choose which behaviour they want? This should also free you maintaining a separate fork.
Yeah, that would probably be the better idea
Installed the latest version of ic-light, the model selection box cannot be opened, the model cannot be selected, the production map is invalid. ![Uploading 屏幕截图 2024-06-26 175645.jpg…]()
This PR is based on #23.
@Haoming02 did amazing improvement on the IC-Light extension.
Here is the list of actual changes made in Haoming's fork:
ic-light
folder with arbitrary filenamesrembg
package insteadimg2img
works: Now the input image is the subject while the extension takes lighting conditions.My changes made on top of Haoming's fork:
/script
folder to/libiclight
folder. The general guideline is that you don't want to put a file with generic name in scripts folder as the namespace is shared with other extensions.Breaking change:
models/unet
tomodels/ic-light
Updated How to use section:
How to use
For best result, it is recommended to use low CFG and strong denosing strength.
Given FG, Generate BG and relight [Txt2Img][HR available]
Infotext:
Given FG and light map, Genereate BG and relight [Img2Img]
Img2Img input image is lightmap. After you select value from the radio, the img2img input will automatically be set by the extension. You can also upload your own lightmap by selecting
Custom
.Infotext:
Given FG and BG, Put FG on BG and relight [Txt2Img][HR available]
Infotext:
[2024-06-06] Restore Detail
Detail transfer was originally implemented in https://github.com/kijai/ComfyUI-IC-Light. It captures high frequency details, e.g. text, in the input fg image and reapplys them to the output image.
Original output:
After detail restore:
Infotext:
[2024-06-06] Reinforce FG
A big problem of IC-Light is that it often alters the FG object's base color too much. By adding the fg image on top of the lightmap, this issue can be alleviated. This essentially implements this comfyui workflow. Here is a comparison:
Without reinforce-fg: You can observe that the fg object almost looks transparent.
With reinforce-fg (Same seed): The fg object no longer look transparent.
Skip remove bg
If the default remove bg cannot achieve your desired effect, you can use other tools to create an RGBA image and uncheck the remove bg checkbox. Image with grey background can also be used the same way as RGBA image.