The whole point of Python environments is so the model doesn't unload itself. That's exactly what you're dealing with now using your C++ slop UI. You're literally repeating the same mistakes that drove ComfyUI and A1111 to use Python in the first place.