r/StableDiffusion • u/parking_bird_6448 • 51m ago
Question - Help Local LLM + ComfyUI
For folks using Local models for ideas/creative brainstorming, how do you manage to load both at the same time ? Or do you swap in-out one or the other ?
I am on a 5090 with 32gb vram but i am left with only 5gb of gpu for Comfy, after I load a Qwen 27B model via llama.cpp
2
Upvotes
4
u/zyg_AI 36m ago
There is no magic trick, if you can't fit both models into VRAM, the only two options I see are
You can free VRAM within comfy between brainstorming and generating. I prefer to run LLMs through LMStudio but it's a personal taste.
2
u/Halloween_Forever_ 25m ago
Load/unload/offload. If you want quality in both, there is no other way. Low b llms aren't very helpful creativity or brainstorming wise, low gb gen models take a lot of polish. I would create a switch. A daahboard that would use llm studio then offload the model to then load your gen model workflow
2
u/Additional_Drive1915 12m ago
I have a 5090, using pretty large LLM. But the loading takes like one second, so I've set it to fist unload any comfy models, then load llm, do it's thing, and then let it release the memory.
This is for videos where the one second load time doesn't matter, but if I'm doing hundreds of images I first let the llm make prompts for all, then run the same images with the prompt already made.
1
u/I_Hate_Reddit 40m ago
I'm using my own chatGPT copy, you have both services running, and load/unload as needed, but with 32GB of ram you can probably fit everything you need outside of video gen, I use Gemma4 moe model instead of a dense one.
1
u/Eastern-Ad9515 14m ago edited 6m ago
This is solved and some of the information in the comments is NOT accurate.
You can have both the local LLM and ComfyUI-Model loaded the same time, as long as both fit in VRAM+RAM. (maybe also including SSD at least according to the wiki)
Why? Because there is a thing called Dynamic-VRAM in ComfyUI. As long as one model (LLM or ComfyUI-Model) is not actively working, the other one uses the VRAM space and the other is sort of idle in RAM.
So what does this mean: If you want to type with the local LLM while rendering, it will be slow for BOTH instances. As long as you separate it, you can have both "active" and working separately. This is much better than loading and unloading the model, because that takes more time.
So how do you achieve this?
Simple:
Step 1: Boot up Claude oder Codex
Step 2: Say, you want to have a local LLM as an orchestrator for comfyUI, but not load/unload the models and use dynamic-VRAM. Make the cloud model design this mode for a local harness like PI or DeepSeek-Harness and your setup (local LLM and ComfyUI-Models) using dynamic VRAM and test it. It should include a heartbeat-monitor for the local llm -> when the local LLM starts a render, it pauses and just has a heartbeat monitor on the comfyui render. When the render ist finished, the local LLM keeps on working
I highly suggest using a cloud model to design and test this mode, and not use the local LLM itself to design this mode and test it.
Of course - if your system doesn't allow it - the alternative is for your cloud model to design a mode that automatically loads and reloads the model that you need. This is also possible, but in my experience the loading of the model and unloading takes much more time than the above mentioned resident wait mode
I use this "resident wait" mode all the time (5090 RTX and 64 GB RAM) and it works (with Qwen 3.8 27B or Flash Next IQ3S + Minimax H3). It works with DeepSeek Harness (as a tool) and also with PI Harness.