Skip to content

Instantly share code, notes, and snippets.

@kampelmuehler
Last active April 23, 2025 05:03
Show Gist options
  • Save kampelmuehler/40d2e8805d268fa9a64aa5aade205ce0 to your computer and use it in GitHub Desktop.
Save kampelmuehler/40d2e8805d268fa9a64aa5aade205ce0 to your computer and use it in GitHub Desktop.
ComfyUI crash under HAMi
apiVersion: v1
kind: Pod
metadata:
name: comfy-hami-test-pod
spec:
containers:
- name: comfyui-container
image: localhost:32000/comfyui:sd15_dreamshaper
resources:
limits:
nvidia.com/gpu: 1
FROM nvcr.io/nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y && apt install -y \
wget \
curl \
git \
python3 \
python3-pip \
python3-venv \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN . /opt/venv/bin/activate
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
RUN pip install --no-cache-dir comfy-cli
WORKDIR /opt
RUN git clone --depth 1 --branch v0.3.29 https://github.com/comfyanonymous/ComfyUI.git
WORKDIR /opt/ComfyUI
RUN pip install --no-cache-dir -r requirements.txt
ENV COMFY_HOME=/opt/ComfyUI
RUN comfy --skip-prompt tracking disable
RUN comfy --skip-prompt set-default ${COMFY_HOME}
RUN wget -O ${COMFY_HOME}/models/checkpoints/dreamshaper_8.safetensors https://civitai.com/api/download/models/128713?type=Model\&format=SafeTensor\&size=pruned
RUN wget -O ${COMFY_HOME}/default.json https://gist.githubusercontent.com/kampelmuehler/40d2e8805d268fa9a64aa5aade205ce0/raw/f57ca4bf9b54324ab07137eb7ddb7203d43781ee/comfytest.yaml
CMD ["bash", "-c", "comfy launch --background && comfy run --workflow /opt/ComfyUI/default.json && comfy stop"]
{
"3": {
"inputs": {
"seed": 1069854818276885,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"4",
0
],
"positive": [
"6",
0
],
"negative": [
"7",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"4": {
"inputs": {
"ckpt_name": "dreamshaper_8.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint"
}
},
"5": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 1
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"text": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"7": {
"inputs": {
"text": "text, watermark",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"3",
0
],
"vae": [
"4",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
}
}
microk8s enable registry
docker build . -t localhost:32000/comfyui:sd15_dreamshaper -f comfyui-cuda12.6.dockerfile
docker push localhost:32000/comfyui:sd15_dreamshaper
microk8s kubectl apply -f comfytest.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment