Skip to content

Commit 0dea7c0

Browse files
committed
feat!: switch default hub model to FLUX.2 klein 9B (Q5_K_M GGUF)
BREAKING CHANGE: The default hub deployment now uses FLUX.2 klein 9B instead of FLUX.1-dev-fp8. Existing workflows using CheckpointLoaderSimple with flux1-dev-fp8.safetensors will not work with the new default image. Use the flux1-dev-fp8 image tag for backward compatibility. - Install ComfyUI-GGUF custom node in Dockerfile base stage - Add flux2-klein-9b model download block (GGUF + text encoder + VAE) - Change default MODEL_TYPE from flux1-dev-fp8 to flux2-klein-9b - Add docker-bake.hcl target and CI/CD workflow entries - Update hub config (description + 25GB container disk) - Add new workflow files for FLUX.2 klein 9B GGUF - Update documentation across README, hub README, and deployment guide - Add diffusion_models + text_encoders to extra_model_paths.yaml Closes #217
1 parent c41432e commit 0dea7c0

13 files changed

Lines changed: 335 additions & 186 deletions

File tree

.changeset/flux2-klein-default.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"worker-comfyui": major
3+
---
4+
5+
feat!: switch default hub model from FLUX.1-dev-fp8 to FLUX.2 klein 9B (Q5_K_M GGUF)
6+
7+
BREAKING CHANGE: The default hub deployment now uses FLUX.2 klein 9B instead of FLUX.1-dev-fp8.
8+
Existing workflows using CheckpointLoaderSimple with flux1-dev-fp8.safetensors will not work
9+
with the new default image. Use the flux1-dev-fp8 image tag for backward compatibility.

.github/workflows/manual-build-all.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,57 @@ jobs:
366366
*.args.RELEASE_VERSION=${{ env.RELEASE_VERSION }}
367367
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }}
368368
369+
build-flux2-klein-9b:
370+
runs-on: [blacksmith-8vcpu-ubuntu-2204, linux]
371+
permissions:
372+
contents: read
373+
374+
steps:
375+
- name: Checkout
376+
uses: actions/checkout@v3
377+
378+
- name: Clear space to remove unused folders
379+
run: |
380+
rm -rf /usr/share/dotnet
381+
rm -rf /opt/ghc
382+
rm -rf "/usr/local/share/boost"
383+
rm -rf "$AGENT_TOOLSDIRECTORY"
384+
385+
- name: Set up QEMU
386+
uses: docker/setup-qemu-action@v3
387+
388+
- name: Set up Docker Buildx
389+
uses: docker/setup-buildx-action@v3
390+
391+
- name: Login to Docker Hub
392+
uses: docker/login-action@v3
393+
with:
394+
username: ${{ secrets.DOCKERHUB_USERNAME }}
395+
password: ${{ secrets.DOCKERHUB_TOKEN }}
396+
397+
- name: blacksmith docker layer cache
398+
uses: useblacksmith/build-push-action@v1
399+
with:
400+
setup-only: true
401+
402+
- name: Set environment variables
403+
run: |
404+
echo "DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO }}" >> $GITHUB_ENV
405+
echo "DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG }}" >> $GITHUB_ENV
406+
echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV
407+
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
408+
409+
- name: Build and push flux2-klein-9b image
410+
uses: docker/bake-action@v2
411+
with:
412+
push: true
413+
targets: flux2-klein-9b
414+
set: |
415+
*.args.DOCKERHUB_REPO=${{ env.DOCKERHUB_REPO }}
416+
*.args.DOCKERHUB_IMG=${{ env.DOCKERHUB_IMG }}
417+
*.args.RELEASE_VERSION=${{ env.RELEASE_VERSION }}
418+
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }}
419+
369420
build-z-image-turbo:
370421
runs-on: [blacksmith-8vcpu-ubuntu-2204, linux]
371422
permissions:
@@ -428,6 +479,7 @@ jobs:
428479
build-flux1-schnell,
429480
build-flux1-dev,
430481
build-flux1-dev-fp8,
482+
build-flux2-klein-9b,
431483
build-z-image-turbo,
432484
]
433485
permissions:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
- flux1-schnell
8585
- flux1-dev
8686
- flux1-dev-fp8
87+
- flux2-klein-9b
8788
- z-image-turbo
8889
- base-cuda12-8-1
8990

.runpod/README.md

Lines changed: 48 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Run [ComfyUI](https://github.com/comfyanonymous/ComfyUI) workflows as a serverle
1212

1313
## What is included?
1414

15-
This worker comes with the **FLUX.1-dev-fp8** (`flux1-dev-fp8.safetensors`) model pre-installed and **works only with this specific model** when deployed from the hub.
15+
This worker comes with the **FLUX.2 klein 9B** (`flux-2-klein-9b-Q5_K_M.gguf`) model pre-installed and **works only with this specific model** when deployed from the hub.
1616

1717
## Want to use a different model?
1818

19-
**The hub deployment only supports FLUX.1-dev-fp8.** If you need any other model, custom nodes, or LoRAs, you have two options:
19+
**The hub deployment only supports FLUX.2 klein 9B (Q5_K_M GGUF).** If you need any other model, custom nodes, or LoRAs, you have two options:
2020

2121
### Option 1: ComfyUI-to-API (Easiest & Recommended)
2222

@@ -60,104 +60,94 @@ This example uses a simplified workflow (replace with your actual workflow JSON)
6060
{
6161
"input": {
6262
"workflow": {
63-
"6": {
63+
"1": {
6464
"inputs": {
65-
"text": "anime cat with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a construction outfit placing a fancy black forest cake with candles on top of a dinner table of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere there are paintings on the walls",
66-
"clip": ["30", 1]
65+
"unet_name": "flux-2-klein-9b-Q5_K_M.gguf"
6766
},
68-
"class_type": "CLIPTextEncode",
67+
"class_type": "UnetLoaderGGUF",
6968
"_meta": {
70-
"title": "CLIP Text Encode (Positive Prompt)"
69+
"title": "Load GGUF Model"
7170
}
7271
},
73-
"8": {
72+
"2": {
7473
"inputs": {
75-
"samples": ["31", 0],
76-
"vae": ["30", 2]
74+
"clip_name": "qwen_3_8b_fp8mixed.safetensors",
75+
"type": "flux2"
7776
},
78-
"class_type": "VAEDecode",
77+
"class_type": "CLIPLoader",
7978
"_meta": {
80-
"title": "VAE Decode"
79+
"title": "Load Text Encoder"
8180
}
8281
},
83-
"9": {
82+
"3": {
8483
"inputs": {
85-
"filename_prefix": "ComfyUI",
86-
"images": ["8", 0]
84+
"vae_name": "flux2-vae.safetensors"
8785
},
88-
"class_type": "SaveImage",
86+
"class_type": "VAELoader",
8987
"_meta": {
90-
"title": "Save Image"
88+
"title": "Load VAE"
9189
}
9290
},
93-
"27": {
91+
"4": {
9492
"inputs": {
95-
"width": 512,
96-
"height": 512,
97-
"batch_size": 1
93+
"text": "anime cat with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a construction outfit placing a fancy black forest cake with candles on top of a dinner table of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere there are paintings on the walls",
94+
"clip": ["2", 0]
95+
},
96+
"class_type": "CLIPTextEncode",
97+
"_meta": {
98+
"title": "CLIP Text Encode (Positive Prompt)"
99+
}
100+
},
101+
"5": {
102+
"inputs": {
103+
"text": "",
104+
"clip": ["2", 0]
98105
},
99-
"class_type": "EmptySD3LatentImage",
106+
"class_type": "CLIPTextEncode",
100107
"_meta": {
101-
"title": "EmptySD3LatentImage"
108+
"title": "CLIP Text Encode (Negative Prompt)"
102109
}
103110
},
104-
"30": {
111+
"6": {
105112
"inputs": {
106-
"ckpt_name": "flux1-dev-fp8.safetensors"
113+
"width": 1024,
114+
"height": 1024,
115+
"batch_size": 1
107116
},
108-
"class_type": "CheckpointLoaderSimple",
117+
"class_type": "EmptyLatentImage",
109118
"_meta": {
110-
"title": "Load Checkpoint"
119+
"title": "Empty Latent Image"
111120
}
112121
},
113-
"31": {
122+
"7": {
114123
"inputs": {
115124
"seed": 243057879077961,
116-
"steps": 10,
125+
"steps": 4,
117126
"cfg": 1,
118127
"sampler_name": "euler",
119128
"scheduler": "simple",
120129
"denoise": 1,
121-
"model": ["30", 0],
122-
"positive": ["35", 0],
123-
"negative": ["33", 0],
124-
"latent_image": ["27", 0]
130+
"model": ["1", 0],
131+
"positive": ["4", 0],
132+
"negative": ["5", 0],
133+
"latent_image": ["6", 0]
125134
},
126135
"class_type": "KSampler",
127136
"_meta": {
128137
"title": "KSampler"
129138
}
130139
},
131-
"33": {
132-
"inputs": {
133-
"text": "",
134-
"clip": ["30", 1]
135-
},
136-
"class_type": "CLIPTextEncode",
137-
"_meta": {
138-
"title": "CLIP Text Encode (Negative Prompt)"
139-
}
140-
},
141-
"35": {
142-
"inputs": {
143-
"guidance": 3.5,
144-
"conditioning": ["6", 0]
145-
},
146-
"class_type": "FluxGuidance",
147-
"_meta": {
148-
"title": "FluxGuidance"
149-
}
150-
},
151-
"38": {
140+
"8": {
152141
"inputs": {
153-
"images": ["8", 0]
142+
"samples": ["7", 0],
143+
"vae": ["3", 0]
154144
},
155-
"class_type": "PreviewImage",
145+
"class_type": "VAEDecode",
156146
"_meta": {
157-
"title": "Preview Image"
147+
"title": "VAE Decode"
158148
}
159149
},
160-
"40": {
150+
"9": {
161151
"inputs": {
162152
"filename_prefix": "ComfyUI",
163153
"images": ["8", 0]

.runpod/hub.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"title": "ComfyUI",
3-
"description": "Generate images with ComfyUI using FLUX.1-dev (fp8)",
3+
"description": "Generate images with ComfyUI using FLUX.2 klein 9B (Q5_K_M GGUF)",
44
"type": "serverless",
55
"category": "image",
66
"iconUrl": "https://cpjrphpz3t5wbwfe.public.blob.vercel-storage.com/comfy-ui.png",
77
"config": {
88
"runsOn": "GPU",
9-
"containerDiskInGb": 20,
9+
"containerDiskInGb": 25,
1010
"gpuIds": "ADA_24",
1111
"gpuCount": 1,
1212
"allowedCudaVersions": ["12.7", "12.6"],

0 commit comments

Comments
 (0)