Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/manual-push-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true
type: string
target_to_build:
description: "The specific target to build (e.g., base, sdxl, sd3, flux1-schnell, flux1-dev)"
description: "The specific target to build (e.g., base, sdxl, sd3, flux1-schnell, flux1-dev, flux1-dev-kontext)"
required: true
type: string

Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ RUN if [ "$MODEL_TYPE" = "flux1-dev-fp8" ]; then \
wget -q -O models/checkpoints/flux1-dev-fp8.safetensors https://huggingface.co/Comfy-Org/flux1-dev/resolve/main/flux1-dev-fp8.safetensors; \
fi

RUN if [ "$MODEL_TYPE" = "flux1-dev-kontext" ]; then \
wget -q --header="Authorization: Bearer ${HUGGINGFACE_ACCESS_TOKEN}" -O models/diffusion_models/flux1-kontext-dev.safetensors https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/resolve/main/flux1-kontext-dev.safetensors; \
wget -q -O models/clip/clip_l.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors && \
wget -q -O models/clip/t5xxl_fp8_e4m3fn.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors && \
wget -q --header="Authorization: Bearer ${HUGGINGFACE_ACCESS_TOKEN}" -O models/vae/ae.safetensors https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/resolve/main/ae.safetensors; \
fi

# Stage 3: Final image
FROM base AS final

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ These images are available on Docker Hub under `runpod/worker-comfyui`:
- **`runpod/worker-comfyui:<version>-base`**: Clean ComfyUI install with no models.
- **`runpod/worker-comfyui:<version>-flux1-schnell`**: Includes checkpoint, text encoders, and VAE for [FLUX.1 schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell).
- **`runpod/worker-comfyui:<version>-flux1-dev`**: Includes checkpoint, text encoders, and VAE for [FLUX.1 dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
- **`runpod/worker-comfyui:<version>-flux1-dev-kontext`**: Includes checkpoint, text encoders, and VAE for [FLUX.1 Kontext dev](https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev).
- **`runpod/worker-comfyui:<version>-sdxl`**: Includes checkpoint and VAEs for [Stable Diffusion XL](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0).
- **`runpod/worker-comfyui:<version>-sd3`**: Includes checkpoint for [Stable Diffusion 3 medium](https://huggingface.co/stabilityai/stable-diffusion-3-medium).

Expand Down
17 changes: 17 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,23 @@ target "flux1-dev-fp8" {
inherits = ["base"]
}

target "flux1-dev-kontext" {
context = "."
dockerfile = "Dockerfile"
target = "final"
args = {
BASE_IMAGE = "${BASE_IMAGE}"
COMFYUI_VERSION = "${COMFYUI_VERSION}"
CUDA_VERSION_FOR_COMFY = "${CUDA_VERSION_FOR_COMFY}"
ENABLE_PYTORCH_UPGRADE = "${ENABLE_PYTORCH_UPGRADE}"
PYTORCH_INDEX_URL = "${PYTORCH_INDEX_URL}"
MODEL_TYPE = "flux1-dev-kontext"
HUGGINGFACE_ACCESS_TOKEN = "${HUGGINGFACE_ACCESS_TOKEN}"
}
tags = ["${DOCKERHUB_REPO}/${DOCKERHUB_IMG}:${RELEASE_VERSION}-flux1-dev-kontext"]
inherits = ["base"]
}

target "base-cuda12-8-1" {
context = "."
dockerfile = "Dockerfile"
Expand Down
10 changes: 5 additions & 5 deletions docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ If you have forked this repository and want to use these actions to publish imag

1. **Secrets** (`Settings > Secrets and variables > Actions > New repository secret`):

| Secret Name | Description | Example Value |
| -------------------------- | -------------------------------------------------------------------------- | ------------------- |
| `DOCKERHUB_USERNAME` | Your Docker Hub username. | `your-dockerhub-id` |
| `DOCKERHUB_TOKEN` | Your Docker Hub access token with read/write permissions. | `dckr_pat_...` |
| `HUGGINGFACE_ACCESS_TOKEN` | Your READ access token from Hugging Face (required only for building SD3). | `hf_...` |
| Secret Name | Description | Example Value |
| -------------------------- | --------------------------------------------------------------------------------- | ------------------- |
| `DOCKERHUB_USERNAME` | Your Docker Hub username. | `your-dockerhub-id` |
| `DOCKERHUB_TOKEN` | Your Docker Hub access token with read/write permissions. | `dckr_pat_...` |
| `HUGGINGFACE_ACCESS_TOKEN` | Your READ access token from Hugging Face (required for SD3, non fp8 flux models). | `hf_...` |

2. **Variables** (`Settings > Secrets and variables > Actions > New repository variable`):

Expand Down
15 changes: 8 additions & 7 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ This is the simplest method if the official images meet your needs.

### GPU recommendations (for Official Images)

| Model | Image Tag Suffix | Minimum VRAM Required | Recommended Container Size |
| ------------------------- | ---------------- | --------------------- | -------------------------- |
| Stable Diffusion XL | `sdxl` | 8 GB | 15 GB |
| Stable Diffusion 3 Medium | `sd3` | 5 GB | 20 GB |
| FLUX.1 Schnell | `flux1-schnell` | 24 GB | 30 GB |
| FLUX.1 dev | `flux1-dev` | 24 GB | 30 GB |
| Base (No models) | `base` | N/A | 5 GB |
| Model | Image Tag Suffix | Minimum VRAM Required | Recommended Container Size |
| ------------------------- | -------------------- | --------------------- | -------------------------- |
| Stable Diffusion XL | `sdxl` | 8 GB | 15 GB |
| Stable Diffusion 3 Medium | `sd3` | 5 GB | 20 GB |
| FLUX.1 Schnell | `flux1-schnell` | 24 GB | 30 GB |
| FLUX.1 dev | `flux1-dev` | 24 GB | 30 GB |
| FLUX.1 dev kontext | `flux1-kontext` | 24 GB | 30 GB |
| Base (No models) | `base` | N/A | 5 GB |

_Note: Container sizes are approximate and might vary slightly. Custom images will vary based on included models/nodes._

Expand Down
166 changes: 166 additions & 0 deletions test_resources/workflows/workflow_flux1_dev_kontext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"input": {
"workflow": {
"5": {
"inputs": {
"width": 1024,
"height": 1024,
"batch_size": 1
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"text": "grey cat wearing a harry potter hat and programming in javascript in its ultramodern computer",
"clip": [
"11",
0
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": [
"13",
0
],
"vae": [
"10",
0
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"8",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
},
"10": {
"inputs": {
"vae_name": "ae.safetensors"
},
"class_type": "VAELoader",
"_meta": {
"title": "Load VAE"
}
},
"11": {
"inputs": {
"clip_name1": "t5xxl_fp8_e4m3fn.safetensors",
"clip_name2": "clip_l.safetensors",
"type": "flux"
},
"class_type": "DualCLIPLoader",
"_meta": {
"title": "DualCLIPLoader"
}
},
"12": {
"inputs": {
"unet_name": "flux1-kontext-dev.safetensors",
"weight_dtype": "default"
},
"class_type": "UNETLoader",
"_meta": {
"title": "Load Diffusion Model"
}
},
"13": {
"inputs": {
"noise": [
"25",
0
],
"guider": [
"22",
0
],
"sampler": [
"16",
0
],
"sigmas": [
"17",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "SamplerCustomAdvanced",
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"16": {
"inputs": {
"sampler_name": "euler"
},
"class_type": "KSamplerSelect",
"_meta": {
"title": "KSamplerSelect"
}
},
"17": {
"inputs": {
"scheduler": "sgm_uniform",
"steps": 4,
"denoise": 1,
"model": [
"12",
0
]
},
"class_type": "BasicScheduler",
"_meta": {
"title": "BasicScheduler"
}
},
"22": {
"inputs": {
"model": [
"12",
0
],
"conditioning": [
"6",
0
]
},
"class_type": "BasicGuider",
"_meta": {
"title": "BasicGuider"
}
},
"25": {
"inputs": {
"noise_seed": 108076821791990
},
"class_type": "RandomNoise",
"_meta": {
"title": "RandomNoise"
}
}
}
}
}