ComfyUI
ComfyUI copied to clipboard
Load Image node leaks colors into transparency with premultiplied alpha images
Expected Behavior
When loading image files with alpha, transparent areas should be transparent. The built-in preview in the load image node is actually correct. This is possibly related to these two issues, but not quite: https://github.com/comfyanonymous/ComfyUI/issues/1515 https://github.com/comfyanonymous/ComfyUI/issues/1162
Actual Behavior
but when connected to other nodes, colors would leak to transparent areas. see the top preview image node.
Steps to Reproduce
-
load an image with premultiplied alpha channel. (I have attached my test pattern file for your reference)
-
connect it's image output to a preview image node.
Debug Logs
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2024-07-06 23:45:52.899387
** Platform: Windows
** Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
** Python executable: C:\StableDiffusion\Data\Packages\ComfyUI\venv\Scripts\python.exe
** ComfyUI Path: C:\StableDiffusion\Data\Packages\ComfyUI
** Log path: C:\StableDiffusion\Data\Packages\ComfyUI\comfyui.log
Prestartup times for custom nodes:
0.0 seconds: C:\StableDiffusion\Data\Packages\ComfyUI\custom_nodes\rgthree-comfy
0.7 seconds: C:\StableDiffusion\Data\Packages\ComfyUI\custom_nodes\ComfyUI-Manager
Total VRAM 24576 MB, total RAM 65462 MB
pytorch version: 2.3.0+cu121
xformers version: 0.0.26.post1
Set vram state to: HIGH_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
Using xformers cross attention
.
.
.
torch version---------------------- 2.3.0+cu121
### Loading: ComfyUI-Impact-Pack (V5.18.12)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.6)
[Impact Pack] Wildcards loading done.
Total VRAM 24576 MB, total RAM 65462 MB
pytorch version: 2.3.0+cu121
xformers version: 0.0.26.post1
Set vram state to: HIGH_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
### Loading: ComfyUI-Manager (V2.44.3)
### ComfyUI Revision: 2340 [2dc84d14] | Released on '2024-07-06'
Other
I discovered this bug while writing my own custom node, it would be super helpful if the default load image node could handle alpha correctly. thank you!