pythongosssss / ComfyUI-Custom-Scripts

Enhancements & experiments for ComfyUI, mostly focusing on UI features
MIT License
1.86k stars 144 forks source link

Fix: fix transparent background when saving the workflow #375

Closed Kathleen-Xu closed 2 weeks ago

Kathleen-Xu commented 1 month ago

Issue

When saving the workflow as a PNG, a white area appears (bug). #359

Cause

The dependency library has adjusted the size of background image on high DPI devices, as shown in the image below. image

Solution

One of the solution is to adjust the size of canvas when saving images(modify the function updateView).

(This issue can also be fixed by temporarily setting window.devicePixelRatio to 1, but it may not seem like a good idea.)