From 5fe91e6bae80d5619c7d48fd8efb9e6e646e3230 Mon Sep 17 00:00:00 2001 From: Towsty Date: Sat, 29 Aug 2026 07:29:31 -0500 Subject: [PATCH] Show Flux and Krea as Image v2 engine cards, and run Krea on edit, compose, and refine. Krea image-to-image uses encode plus denoise graphs, not Klein reference latents, and still fails closed if the Krea models are missing. Co-authored-by: Cursor --- docs/image-v2.md | 18 ++-- pages/index.vue | 114 +++++++++++--------- server/api/v2/generate.post.ts | 19 ++-- server/assets/krea_v2_compose.json | 122 +++++++++++++++++++++ server/assets/krea_v2_edit.json | 95 +++++++++++++++++ server/assets/krea_v2_refine.json | 141 ++++++++++++++++++++++++ server/utils/generationPresets.ts | 11 +- server/utils/imageChainV2.ts | 20 ++-- server/utils/imageWorkflowV2.ts | 166 +++++++++++++++++++++++------ server/utils/studioQueue.ts | 6 +- utils/imageV2.ts | 9 +- utils/libraryGeneration.ts | 6 +- 12 files changed, 608 insertions(+), 119 deletions(-) create mode 100644 server/assets/krea_v2_compose.json create mode 100644 server/assets/krea_v2_edit.json create mode 100644 server/assets/krea_v2_refine.json diff --git a/docs/image-v2.md b/docs/image-v2.md index 924065d..ba4cd9a 100644 --- a/docs/image-v2.md +++ b/docs/image-v2.md @@ -6,12 +6,12 @@ Image edit (v1) and Image v2 are siblings. v1 is unchanged. Do not mute-fix `wor |---|---|---| | Tab | Image edit | Image v2 | | Route | `POST /api/edit` | `POST /api/v2/generate` and `POST /v2/generate` | -| Graphs | One file, prune unused branch | `klein_v2_edit.json`, `klein_v2_compose.json`, `klein_v2_refine.json`, `klein_v2_generate.json`, or `krea_v2_generate.json` | +| Graphs | One file, prune unused branch | Klein or Krea graphs per mode. Engine is always visible. | | Second still | Optional; switches branch | Compose only; required. Mismatch is a 400 | | Mask | — | Refine only; required. Missing mask is a 400, not an Edit fallback | | Input still | Required | Edit / Compose / Refine required. Generate ignores stills | -| LoRAs | Optional user picker | Consistency (Flux). Concept LoRA on xAIGen only. Generate Consistency off. Krea Generate has no Consistency | -| Defaults | 20 steps, CFG 1 | Flux: 24 steps, CFG 4 (turbo: 8 / 1). Krea Generate: 8 steps, CFG 1 | +| LoRAs | Optional user picker | Consistency (Flux only). Concept LoRA on xAIGen only. Krea has no Consistency | +| Defaults | 20 steps, CFG 1 | Flux: 24 steps, CFG 4 (turbo: 8 / 1). Krea: 8 steps, CFG 1 | Poll v2 jobs the same way as v1: `GET /api/generate/{id}/stream` and `GET /api/generate/{id}`. @@ -20,7 +20,7 @@ Poll v2 jobs the same way as v1: `GET /api/generate/{id}/stream` and `GET /api/g - **edit** — one image + text. Task is `scene`. Sending `image_b` is rejected. Use this to change lighting, background, or the whole frame from a single still. - **compose** — two images + text. `image_b` is required. No silent one-image fallback. Use this to lock a person from A and pull a face or outfit from B. - **refine** — one canvas + a painted mask + text. `image_a` and `mask` are required. `image_b` is ignored. Prompt only what should change inside the mask. Strength is denoise in that region (not CFG). Use this for face / hand / chest fixes without opening Comfy. -- **generate** — text only. No `image_a`, `image_b`, or mask. Size is width × height (768 / 1024 / 1280), not megapixels from a still. Engine is Flux (`klein_v2_generate.json`) or Krea (`krea_v2_generate.json`). Edit / Compose / Refine stay Flux. +- **generate** — text only. No `image_a`, `image_b`, or mask. Size is width × height (768 / 1024 / 1280), not megapixels from a still. Engine is Flux or Krea for every Image v2 mode. Video stays MiniMax / LTX. Compose tasks: @@ -37,6 +37,7 @@ Dummy tests: - Refine + last good gen + mask on the left breast + “red X painted on the left breast” at strength 0.4. Pass = X on the breast, face/pose/background stay. Fail = whole image regenerates, or nothing changes. - Generate + Flux + “a red cube on a white table, studio light” and no stills. Pass = a new image of that. Fail = missing-image error, or the output equals the last Edit/Compose still. - Generate + Krea + the same prompt. Pass = `krea_v2_generate.json` is queued. Fail = Flux graph runs under a Krea label, or a missing Krea model falls back to Flux. +- Edit + Krea + one still. Pass = `krea_v2_edit.json`. Fail = Klein graph or Generate empty latent. ## Nodes the mapper patches @@ -97,9 +98,11 @@ Generate Krea (`krea_v2_generate.json`): | `15` | `KSampler` euler / simple, default 8 steps, CFG 1 | | `9` / `10` | Prompt / negative from the API | -Krea does not load Klein UNET, Klein CLIP, Klein VAE, Klein Consistency, or the Klein concept LoRA. Missing Krea diffusion / text encoder / VAE fails the job. Concept LoRA (`klein_snofs_v1_4`) is xAIGen only; AIGen bypasses that node. On Krea it stays off unless `NUXT_KREA_CONCEPT_LORA` is set on xAIGen. +Krea Edit / Compose / Refine use the same UNET / CLIP / VAE. They encode the still (`VAEEncode`) and sample with denoise < 1. Krea has no Klein `ReferenceLatent`. Compose stitches A then B (`ImageStitch`) so both stills are in the latent. Missing Krea models fail the job. No Flux fallback. -There is no `LoadImage`. If the executed Generate graph has a required LoadImage, the job fails. v1 node 145 (muted T2I with a baked prompt) is not used. +Krea does not load Klein UNET, Klein CLIP, Klein VAE, Klein Consistency, or the Klein concept LoRA. Concept LoRA (`klein_snofs_v1_4`) is xAIGen only; AIGen bypasses that node. On Krea it stays off unless `NUXT_KREA_CONCEPT_LORA` is set on xAIGen. + +There is no `LoadImage` on Generate. If the executed Generate graph has a required LoadImage, the job fails. v1 node 145 (muted T2I with a baked prompt) is not used. If `image_b` is sent on Edit/Compose and the executed graph has fewer than two `LoadImage` nodes, the job fails. If Refine runs without a mask input or without denoise on the scheduler, the job fails. @@ -114,7 +117,7 @@ If `image_b` is sent on Edit/Compose and the executed graph has fewer than two ` | Steps | 24 (turbo 8) | | CFG | 4 (turbo 1) | | Scale to MP | 1.0 lanczos | -| Strength (denoise) | 0.35 on Refine only. Hidden on Edit/Compose/Generate. Range 0.15–0.75 | +| Strength (denoise) | 0.35 on Flux Refine. Krea Edit 0.75, Compose 0.70, Refine uses the slider. Hidden on Flux Edit/Compose/Generate. Range 0.15–0.75 | | Size | Generate only. 1:1 1024×1024, 3:4 768×1024, 4:3 1024×768, 16:9 1280×768, 9:16 768×1280 | ### When to use each Refine strength @@ -133,5 +136,6 @@ Do not raise Strength to rewrite the whole frame. If the face or background move - **refine** — prompt only the masked change. Face vs hand/chest chips set Strength and LoRAs together. - **generate / Flux** — On xAIGen, Concept LoRA defaults 0.65 / 0.35. On AIGen the node is not loaded. Consistency stays 0. Turbo is 8 steps / CFG 1. - **generate / Krea** — 8 steps, CFG 1, no Consistency. Concept LoRA stays 0 unless a Krea concept file is configured. +- **edit / compose / refine / Krea** — same 8 / CFG 1. Strength is denoise on the encoded still. Compose stitches A|B. Presets on this tab store sliders + mode + task + engine (+ Strength when Refine, + size when Generate). They do not load v1 LoRA stacks or a cached latent. Missing engine on an old preset is Flux. diff --git a/pages/index.vue b/pages/index.vue index 36e222e..35ef8f7 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -711,29 +711,29 @@

Edit, Compose, Refine, and Generate are separate graphs. Shares the desktop GPU with video.

+

Image engine

+
+ + +
+

Flux is Klein 9B. Krea is Krea 2 Turbo. Video stays MiniMax or LTX.

-
-

Engine

-
- - -
-

Flux is the current edit and compose engine. Krea is a separate photograph engine.

-

Size · near 1 MP

@@ -750,7 +750,7 @@
-
+
-
+