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
9 changes: 9 additions & 0 deletions .changeset/flux2-klein-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"worker-comfyui": major
---

feat!: switch default hub model from FLUX.1-dev-fp8 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.
52 changes: 52 additions & 0 deletions .github/workflows/manual-build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,57 @@ jobs:
*.args.RELEASE_VERSION=${{ env.RELEASE_VERSION }}
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }}

build-flux2-klein-9b:
runs-on: [blacksmith-8vcpu-ubuntu-2204, linux]
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Clear space to remove unused folders
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf "/usr/local/share/boost"
rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: blacksmith docker layer cache
uses: useblacksmith/build-push-action@v1
with:
setup-only: true

- name: Set environment variables
run: |
echo "DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO }}" >> $GITHUB_ENV
echo "DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG }}" >> $GITHUB_ENV
echo "HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV

- name: Build and push flux2-klein-9b image
uses: docker/bake-action@v2
with:
push: true
targets: flux2-klein-9b
set: |
*.args.DOCKERHUB_REPO=${{ env.DOCKERHUB_REPO }}
*.args.DOCKERHUB_IMG=${{ env.DOCKERHUB_IMG }}
*.args.RELEASE_VERSION=${{ env.RELEASE_VERSION }}
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ env.HUGGINGFACE_ACCESS_TOKEN }}

build-z-image-turbo:
runs-on: [blacksmith-8vcpu-ubuntu-2204, linux]
permissions:
Expand Down Expand Up @@ -428,6 +479,7 @@ jobs:
build-flux1-schnell,
build-flux1-dev,
build-flux1-dev-fp8,
build-flux2-klein-9b,
build-z-image-turbo,
]
permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
- flux1-schnell
- flux1-dev
- flux1-dev-fp8
- flux2-klein-9b
- z-image-turbo
- base-cuda12-8-1

Expand Down
106 changes: 48 additions & 58 deletions .runpod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Run [ComfyUI](https://github.com/comfyanonymous/ComfyUI) workflows as a serverle

## What is included?

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.
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.

## Want to use a different model?

**The hub deployment only supports FLUX.1-dev-fp8.** If you need any other model, custom nodes, or LoRAs, you have two options:
**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:

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

Expand Down Expand Up @@ -60,104 +60,94 @@ This example uses a simplified workflow (replace with your actual workflow JSON)
{
"input": {
"workflow": {
"6": {
"1": {
"inputs": {
"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",
"clip": ["30", 1]
"unet_name": "flux-2-klein-9b-Q5_K_M.gguf"
},
"class_type": "CLIPTextEncode",
"class_type": "UnetLoaderGGUF",
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
"title": "Load GGUF Model"
}
},
"8": {
"2": {
"inputs": {
"samples": ["31", 0],
"vae": ["30", 2]
"clip_name": "qwen_3_8b_fp8mixed.safetensors",
"type": "flux2"
},
"class_type": "VAEDecode",
"class_type": "CLIPLoader",
"_meta": {
"title": "VAE Decode"
"title": "Load Text Encoder"
}
},
"9": {
"3": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": ["8", 0]
"vae_name": "flux2-vae.safetensors"
},
"class_type": "SaveImage",
"class_type": "VAELoader",
"_meta": {
"title": "Save Image"
"title": "Load VAE"
}
},
"27": {
"4": {
"inputs": {
"width": 512,
"height": 512,
"batch_size": 1
"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",
"clip": ["2", 0]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"5": {
"inputs": {
"text": "",
"clip": ["2", 0]
},
"class_type": "EmptySD3LatentImage",
"class_type": "CLIPTextEncode",
"_meta": {
"title": "EmptySD3LatentImage"
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"30": {
"6": {
"inputs": {
"ckpt_name": "flux1-dev-fp8.safetensors"
"width": 1024,
"height": 1024,
"batch_size": 1
},
"class_type": "CheckpointLoaderSimple",
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Load Checkpoint"
"title": "Empty Latent Image"
}
},
"31": {
"7": {
"inputs": {
"seed": 243057879077961,
"steps": 10,
"steps": 4,
"cfg": 1,
"sampler_name": "euler",
"scheduler": "simple",
"denoise": 1,
"model": ["30", 0],
"positive": ["35", 0],
"negative": ["33", 0],
"latent_image": ["27", 0]
"model": ["1", 0],
"positive": ["4", 0],
"negative": ["5", 0],
"latent_image": ["6", 0]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"33": {
"inputs": {
"text": "",
"clip": ["30", 1]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"35": {
"inputs": {
"guidance": 3.5,
"conditioning": ["6", 0]
},
"class_type": "FluxGuidance",
"_meta": {
"title": "FluxGuidance"
}
},
"38": {
"8": {
"inputs": {
"images": ["8", 0]
"samples": ["7", 0],
"vae": ["3", 0]
},
"class_type": "PreviewImage",
"class_type": "VAEDecode",
"_meta": {
"title": "Preview Image"
"title": "VAE Decode"
}
},
"40": {
"9": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": ["8", 0]
Expand Down
4 changes: 2 additions & 2 deletions .runpod/hub.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"title": "ComfyUI",
"description": "Generate images with ComfyUI using FLUX.1-dev (fp8)",
"description": "Generate images with ComfyUI using FLUX.2 klein 9B (Q5_K_M GGUF)",
"type": "serverless",
"category": "image",
"iconUrl": "https://cpjrphpz3t5wbwfe.public.blob.vercel-storage.com/comfy-ui.png",
"config": {
"runsOn": "GPU",
"containerDiskInGb": 20,
"containerDiskInGb": 25,
"gpuIds": "ADA_24",
"gpuCount": 1,
"allowedCudaVersions": ["12.7", "12.6"],
Expand Down
Loading
Loading