Self-hosted AI image generator: specs wey go work
See the honest hardware ladder for Stable Diffusion: CPU VPS fit run SD 1.5 in 1-2 minutes, while SDXL need 6.94 GB model file, ComfyUI commands, and disk.
Wetin self-hosted AI image generator really need
Self-hosted AI image generator na one web app plus one model file. The app na ComfyUI, and e fit run for any Linux box. Na the model dey decide the hardware wey you need. SDXL-class checkpoint na one 6.94 GB file, and e need stay for GPU memory. Na this one fact dey set the whole budget, so read the hardware ladder below before you rent anything.
The honest summary be say: CPU-only VPS fit install and serve the software, and e fit generate images for 512x512 with older Stable Diffusion 1.5 model in one or two minutes for each image. The same box wey dey run SDXL for 1024x1024 fit take ten to twenty minutes for each image. This no mean say setup don break. Na arithmetic, and this guide go explain am.
Wetin model size dey decide for machine
Image generation dey run denoising loop. A 30-step render dey pass the full model over the image 30 times, and each pass dey read every weight. SDXL for half precision dey about 6.9 GB of weights, so a 30-step render dey move roughly 200 GB through memory before you see picture.
GPU wey get 24 GB of video memory (VRAM, na the memory wey dem solder next to graphics chip) dey read at hundreds of gigabytes per second, and e fit hold all 6.9 GB at once. CPU VPS dey read system RAM at tens of gigabytes per second, and e no get matrix hardware for the convolutions, so the same loop dey run one to two orders of magnitude slower. Na the same memory-bandwidth argument wey dey control text models, and e good make you read am together with when VPS with GPU really worth the money.
Image generation different from text generation for one way wey matter. Chat model dey stream tokens, so slow machine still dey feel usable because words dey appear as you dey read. Image no go appear until the last step finish. Slow machine mean say you go dey stare progress bar.
Hardware ladder, wey get real numbers
The block below get typical figures for one SDXL image for 1024x1024, 30 steps, Euler sampler, as of July 2026. Treat dem as approximate range. Your sampler, step count and resolution fit change dem.
The data behind this chart
[
{
"label": "8 vCPU VPS, no GPU",
"seconds_per_image": 780
},
{
"label": "8GB VRAM GPU",
"seconds_per_image": 32
},
{
"label": "12GB VRAM GPU",
"seconds_per_image": 18
},
{
"label": "24GB VRAM GPU",
"seconds_per_image": 9
}
]The CPU row na 780 seconds, roughly thirteen minutes. The 24 GB card na 9 seconds. Na this difference you dey pay for.
Read the ladder like this. Below 8 GB of VRAM, SDXL still dey run, because ComfyUI dey offload layers go system RAM automatically and e fit drive card wey get as little as 1 GB. Offloading dey add time for every step, so 6 GB card go dey closer to one minute per image than thirty seconds. For 8 GB, the base model fit enter and render go dey comfortable. For 12 GB, you fit keep one or two ControlNet together with the checkpoint without offloading. For 24 GB, you fit run SDXL plus the refiner plus upscaling inside one workflow, and you fit start training LoRA adapters, wey need much more memory than image generation.
Wetin CPU VPS fit do and wetin e no fit do
E fit do pass wetin people dey expect, and e fit do less than wetin marketing dey imply. Make you specify the exact boundary.
CPU VPS fit install ComfyUI, serve the web interface, keep your model library, run the queue, and generate images without any GPU at all. With Stable Diffusion 1.5 for 512x512 and 20 steps, expect roughly 60 to 150 seconds for each image on 8 modern vCPUs with 16 GB of RAM. For batch job wey go run overnight, or low-volume image endpoint behind queue, this one genuinely dey okay.
CPU VPS no fit give you interactive work. Prompt iteration mean twenty renders for one hour, and if each one take thirteen minutes, you go get four. E still no fit train. LoRA fine-tuning for CPU dey take days, no be hours, so treat am like say e no dey available.
Memory rule for CPU-only different from GPU rule. The weights go load into system RAM, so you need the model size plus working space: about 16 GB of RAM for SDXL, and about 8 GB for SD 1.5. 4 GB box go start ComfyUI, then out-of-memory killer go kill am halfway through the first render. You go see this as the process disappear with Killed inside dmesg and no Python traceback.
Install ComfyUI for GPU machine
Na be upstream commands be these. Start with clean Ubuntu 24.04 installation wey NVIDIA driver don already dey inside. Confirm the driver first, because without this check, every later failure go look the same.
nvidia-smiE suppose print table wey show your card and CUDA version. command not found, or NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver, mean say driver no dey, or the kernel module no load after upgrade. Fix that one before you continue, because ComfyUI fit quietly fall back to CPU and you go blame the software.
sudo apt update
sudo apt install -y git python3-venv python3-pip wget
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
python3 -m venv venv
. venv/bin/activate
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130
pip install -r requirements.txtVirtual environment no be optional advice. PyTorch dey pull plenty dependencies, and if you install am system-wide for machine wey dey run other things, na so you go break the other thing. Confirm say PyTorch fit see the card before you continue.
python -c "import torch; print(torch.cuda.is_available(), torch.cuda.get_device_name(0))"True plus your card name mean say the stack dey work. False mean say the wheel wey you install no match the driver. Most times, na because CPU-only torch wheel don already dey cache. Reinstall am with the index URL above.
Get model, and plan for the disk
ComfyUI no get weights when you install am. Checkpoints dey go for models/checkpoints, VAE files dey go for models/vae, and LoRA adapters dey go for models/loras.
cd ~/ComfyUI/models/checkpoints
wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensorsAlways prefer .safetensors instead of .ckpt. .ckpt file na pickled Python object, and when you load am, e go execute code from whoever build the file. safetensors format hold tensors only, so hostile file no fit run anything.
Storage na cost wey people dey forget. One SDXL base checkpoint na 6.94 GB. The refiner na another 6 GB. One ControlNet model fit use 1.4 to 2.5 GB, one upscaler fit use 60 to 350 MB, and one LoRA fit use 20 to 400 MB. Person wey enjoy this kind work go download second and third base model within one week. Plan 100 GB disk space for working install, and monitor the outputs directory too: 1024x1024 PNG files dey take 1 to 2 MB each, and unattended batch fit quietly fill small disk. Put models/ and output/ for volume wey you fit expand, and back up your workflow JSON files with something like encrypted incremental backups to object storage. You fit download the weights again. But you no fit download the workflows wey you don tune.
Run am, then reach am safely
cd ~/ComfyUI
. venv/bin/activate
python main.py --listen 127.0.0.1 --port 8188ComfyUI dey serve for port 8188. For machine wey na CPU-only, add --cpu. This one go force CPU path instead of failing because CUDA device no dey.
Bind am to 127.0.0.1, no be 0.0.0.0. ComfyUI no get login screen and no user accounts. Anything wey reach the port fit queue jobs, read every image wey you don generate, and install custom nodes. This one mean arbitrary code execution for your server. Instead, reach am through SSH tunnel from your laptop.
ssh -N -L 8188:127.0.0.1:8188 you@your-serverThen open http://127.0.0.1:8188 locally. If you need real multi-user access, put reverse proxy with authentication in front of am and keep the app bound to localhost. This same reason apply to any unauthenticated self-hosted service. Na the standard pattern for Docker Compose deployments for VPS.
Make e continue to run under systemd
Render queue wey dey die once your SSH session close no be service. Write /etc/systemd/system/comfyui.service.
[Unit]
Description=ComfyUI
After=network-online.target
[Service]
User=comfy
WorkingDirectory=/home/comfy/ComfyUI
ExecStart=/home/comfy/ComfyUI/venv/bin/python main.py --listen 127.0.0.1 --port 8188
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now comfyui
systemctl status comfyuiactive (running) and log line wey dey read To see the GUI go to: http://127.0.0.1:8188 mean say e don start. Note say ExecStart name the interpreter wey dey inside virtual environment directly, because systemd no dey run your shell profile and activate no dey happen.
Recommendation wey make sense based on budget
If you wan try image generation and speed no matter pass cost, use CPU VPS wey get 16 GB RAM, run SD 1.5 for 512x512, and accept say each image fit take one or two minutes. Na this be the honest entry point, and e cost only small part of anything wey get GPU attached. E also be correct place to host the model library and workflows while you dey decide.
If you dey change prompts every day, rent GPU wey get at least 12 GB VRAM by the hour from GPU cloud, and shut am down when you stop. Image generation na bursty work, and GPU wey dey idle but dem still bill am monthly na the commonest way people dey overspend for this matter. Keep the checkpoints for cheap block storage and mount dem.
If you dey serve other people, or you dey train LoRA adapters, you need 24 GB VRAM and machine wey you go keep. For that point, the same box usually dey useful to run local language model too. Na this setup self-hosting LLM with Ollama describe.
Any rung wey you choose, measure your own machine before you believe any figure wey dem publish. Queue the same prompt five times and read the seconds-per-iteration wey ComfyUI print for console. That number na your real position for the ladder.
FAQ
I fit run Stable Diffusion without GPU?
Yes. ComfyUI dey run with python main.py --cpu and dey generate real images even when graphics card no dey. Expect around 60 to 150 seconds for each image with Stable Diffusion 1.5 for 512x512, and ten to twenty minutes for SDXL for 1024x1024, on 8 modern vCPUs. E dey work for overnight batches and endpoints wey no get plenty traffic. E no work for prompt iteration, and training no dey practical at all.
How much VRAM I need for SDXL?
8 GB dey run SDXL comfortably for 1024x1024. If VRAM pass below that, ComfyUI go automatically offload layers go system RAM and still work, reach about 1 GB of VRAM, but every offloaded step go add time. 12 GB let you keep ControlNet together with the checkpoint, while 24 GB fit handle base plus refiner plus upscaling for one workflow, and na the practical minimum for training LoRA adapters.
How much disk space the models need?
The SDXL base checkpoint alone na 6.94 GB, and the refiner add about 6 GB more. ControlNet models dey take 1.4 to 2.5 GB each, LoRA adapters 20 to 400 MB, and upscalers reach 350 MB. Plan 100 GB for working install with some base models, and monitor the output directory separately, because 1024x1024 PNG files dey take 1 to 2 MB each.
E safe to expose ComfyUI for public internet?
No. ComfyUI no get authentication at all, and e custom-node system dey install and run Python code from the interface. So, open port mean remote code execution for your server. Bind am to 127.0.0.1, reach am through SSH tunnel with ssh -N -L 8188:127.0.0.1:8188 you@your-server, and put authenticating reverse proxy in front of am if more than one person need access.
Why my render get killed without error message?
If the process disappear with Killed for dmesg and no Python traceback show, na Linux out-of-memory killer cause am, no be ComfyUI bug. For CPU-only machine, the weights dey stay for system RAM. So, SDXL need about 16 GB and SD 1.5 about 8 GB, plus working space. Add more RAM, add swap, or change to smaller model and lower resolution.