Files
CthomasdesignandClaude Opus 4.8 0f46e19cbc feat: Krea2Img2Img node — image-to-image on Turbo/MLX (v0.5.0)
New additive node (existing four untouched): VAE-encodes a source image
and denoises from a noised version of it. Rectified-flow interpolant
x_t=(1-t)·z0+t·noise, entering the schedule at t=denoise; denoise=1.0
takes the exact txt2img code path (verified pixel-identical to the
parity reference — the hard guard that generation is undisturbed).

Engine changes are additive: sample() gains init_latent/strength
(strength>=1.0 is a byte-identical no-op), pipeline gains
generate_img2img() reusing the prompt cache + LoRA path, nodes.py gains
_from_image_tensor. VAE encode input range verified [-1,1] (round-trip
45 dB). Denoise sweep 0.3→0.9 is monotonic and coherent; contact sheet
and strength=1.0 guard in tools/test_img2img.py.

First rung of the image-conditioning ladder (img2img → in-context edit
→ grounded vision); reuses the VAE-encode plumbing the edit path needs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 16:47:06 -04:00

84 lines
2.1 KiB
JSON

{
"last_node_id": 5,
"last_link_id": 3,
"nodes": [
{
"id": 1,
"type": "Krea2ModelLoader",
"pos": [80, 120],
"size": [340, 60],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{ "name": "krea2_pipe", "type": "KREA2_PIPE", "links": [1], "slot_index": 0 }
],
"properties": { "Node name for S&R": "Krea2ModelLoader" },
"widgets_values": ["transformer_mixed_4_8.safetensors"]
},
{
"id": 5,
"type": "LoadImage",
"pos": [80, 240],
"size": [340, 320],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{ "name": "IMAGE", "type": "IMAGE", "links": [2], "slot_index": 0 },
{ "name": "MASK", "type": "MASK", "links": null, "slot_index": 1 }
],
"properties": { "Node name for S&R": "LoadImage" },
"widgets_values": ["example.png", "image"]
},
{
"id": 2,
"type": "Krea2Img2Img",
"pos": [460, 120],
"size": [360, 320],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{ "name": "krea2_pipe", "type": "KREA2_PIPE", "link": 1 },
{ "name": "image", "type": "IMAGE", "link": 2 },
{ "name": "lora_stack", "type": "KREA2_LORASTACK", "link": null }
],
"outputs": [
{ "name": "IMAGE", "type": "IMAGE", "links": [3], "slot_index": 0 }
],
"properties": { "Node name for S&R": "Krea2Img2Img" },
"widgets_values": [
"the same scene, cinematic lighting, highly detailed",
0.6, 1024, 1024, 8, 0, "fixed", 1, true
]
},
{
"id": 3,
"type": "SaveImage",
"pos": [880, 120],
"size": [400, 420],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{ "name": "images", "type": "IMAGE", "link": 3 }
],
"outputs": [],
"properties": { "Node name for S&R": "SaveImage" },
"widgets_values": ["krea2_img2img"]
}
],
"links": [
[1, 1, 0, 2, 0, "KREA2_PIPE"],
[2, 5, 0, 2, 1, "IMAGE"],
[3, 2, 0, 3, 0, "IMAGE"]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}