chrisgoringe / cg-image-picker

227 stars 15 forks source link

Preview FABRIC Preview Chooser - Memory Management Problems #63

Closed revolvedai closed 7 months ago

revolvedai commented 8 months ago

I am not sure if this issue is for this node or FABRIC, but there seems to be a memory leak or memory management issue when using the Fabric Preview Chooser. I am uploading my workflow that I would love to modify with the FABRIC Preview Chooser nodes. Using on a 24GB GPU.

On the first run, it works great. 16 images generate with SDXL Turbo, I can choose as many latents as I want, put them forward to a batch of 4, choose as many latents there, another batch of 4, then generate on the high quality section of my workflow on the bottom.

However, on the second run it seems that the FABRIC images in the nodes stay there and clog up the memory. SO it always runs into CUDA errors. First time I restart - fine, any time after that, CUDA. I can sometimes squeeze it in with less latents etc.

Perhaps when "Queue Prompt" is clicked, it could clear out the FABRIC Chooser nodes? That may help prevent CUDA errors. I am already using xformers.

I know that FABRIC nodes are not quite working like they should in SDXL, but still would like to try to get something working for when they do! Fantastic work.

Here's the workflow: SDTune_Turbo_v2FABRIC (2).json On Civitai (without Fabric): https://civitai.com/models/217489/sdtune-tuned-ip-adapter-workflow-for-comfyui

chrisgoringe commented 7 months ago

The internal caches are cleared on restart, so not sure what else there is to do.

A lot has changed around Fabric, so closing this - please reopen if it's still a real thing.