From 1cd51c98ece21017ca542c2c9b4804b28cb0d66f Mon Sep 17 00:00:00 2001 From: Morpheus Date: Mon, 21 Sep 2026 14:09:27 +0000 Subject: [PATCH] Add Flux2 Klein photorealistic image edit workflow --- optimized/image-edit/README.md | 3 +++ .../README.md | 20 ++++++++++++++ .../ui-workflow.json | 26 +++++++++++++++++++ .../workflow.json | 21 +++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 optimized/image-edit/README.md create mode 100644 optimized/image-edit/flux2klein-9b-photorealistic-character/README.md create mode 100644 optimized/image-edit/flux2klein-9b-photorealistic-character/ui-workflow.json create mode 100644 optimized/image-edit/flux2klein-9b-photorealistic-character/workflow.json diff --git a/optimized/image-edit/README.md b/optimized/image-edit/README.md new file mode 100644 index 0000000..11fe93f --- /dev/null +++ b/optimized/image-edit/README.md @@ -0,0 +1,3 @@ +# Image-edit workflows + +The current image-edit baseline is the Flux.2 Klein photorealistic character conversion workflow. diff --git a/optimized/image-edit/flux2klein-9b-photorealistic-character/README.md b/optimized/image-edit/flux2klein-9b-photorealistic-character/README.md new file mode 100644 index 0000000..c8bd01a --- /dev/null +++ b/optimized/image-edit/flux2klein-9b-photorealistic-character/README.md @@ -0,0 +1,20 @@ +# Flux.2 Klein — photorealistic character conversion + +Converts a stylized character reference into a photorealistic full-body editorial photograph while preserving identity, pose, clothing, accessories, and framing. + +## Tested baseline + +- Reference input: `character_reference.png` +- Model: `flux-2-klein-9b-fp8mixed.safetensors` +- Text encoder: `qwen_3_8b_fp8mixed.safetensors` (`flux2`) +- VAE: `full_encoder_small_decoder.safetensors` +- Sampler: Euler +- Steps: 4 +- CFG: 1.0 +- Seed: `20260921` +- Measured runtime: approximately 89 seconds on the RTX 3070 + +Files: + +- `workflow.json` — API-format prompt. +- `ui-workflow.json` — native ComfyUI web-editor workflow. diff --git a/optimized/image-edit/flux2klein-9b-photorealistic-character/ui-workflow.json b/optimized/image-edit/flux2klein-9b-photorealistic-character/ui-workflow.json new file mode 100644 index 0000000..3c6ebb5 --- /dev/null +++ b/optimized/image-edit/flux2klein-9b-photorealistic-character/ui-workflow.json @@ -0,0 +1,26 @@ +{ + "id":"flux2klein-character-edit-ui","revision":0,"last_node_id":125,"last_link_id":24, + "nodes":[ + {"id":1,"type":"LoadImage","pos":[-900,500],"size":[320,420],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[1]}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["character_reference.png","image"]}, + {"id":70,"type":"UNETLoader","pos":[-500,100],"size":[370,110],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[2]}],"properties":{"Node name for S&R":"UNETLoader"},"widgets_values":["flux-2-klein-9b-fp8mixed.safetensors","default"]}, + {"id":71,"type":"CLIPLoader","pos":[-500,280],"size":[370,150],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"CLIP","type":"CLIP","links":[3]}],"properties":{"Node name for S&R":"CLIPLoader"},"widgets_values":["qwen_3_8b_fp8mixed.safetensors","flux2","default"]}, + {"id":72,"type":"VAELoader","pos":[-500,500],"size":[370,110],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"VAE","type":"VAE","links":[4,5]}],"properties":{"Node name for S&R":"VAELoader"},"widgets_values":["full_encoder_small_decoder.safetensors"]}, + {"id":80,"type":"ImageScaleToTotalPixels","pos":[-500,720],"size":[270,140],"flags":{},"order":4,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":1}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[6,7]}],"properties":{"Node name for S&R":"ImageScaleToTotalPixels"},"widgets_values":["nearest-exact",1.0,1]}, + {"id":99,"type":"GetImageSize","pos":[-100,720],"size":[230,120],"flags":{},"order":5,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":7}],"outputs":[{"name":"width","type":"INT","links":[8,9]},{"name":"height","type":"INT","links":[10,11]}],"properties":{"Node name for S&R":"GetImageSize"},"widgets_values":[]}, + {"id":124,"type":"VAEEncode","pos":[-100,500],"size":[230,100],"flags":{},"order":6,"mode":0,"inputs":[{"name":"pixels","type":"IMAGE","link":6},{"name":"vae","type":"VAE","link":4}],"outputs":[{"name":"LATENT","type":"LATENT","links":[12,13]}],"properties":{"Node name for S&R":"VAEEncode"},"widgets_values":[]}, + {"id":74,"type":"CLIPTextEncode","pos":[0,40],"size":[650,400],"flags":{},"order":7,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[14]}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["Transform the provided stylized character illustration into a photorealistic full-body editorial street-fashion photograph of the same adult male character. Preserve the exact identity, facial structure, skin tone, hairstyle, trimmed goatee, round sunglasses, backward purple-and-green baseball cap, gold hoop earring, layered gold chains, purple oversized satin bomber jacket, white graphic T-shirt, loose olive-green cargo pants, white socks and purple-white sneakers, the relaxed confident pose, hand positions, three-quarter stance, full-body framing and outfit color palette. Replace the flat illustrated rendering with natural human skin texture, realistic pores, believable facial anatomy, physically accurate fabric, stitching, metallic jewelry reflections, detailed sneakers, realistic hands and fingers, true-to-life proportions, subtle imperfection, cinematic soft daylight, warm golden-hour key light, gentle directional shadows, shallow but sufficient depth of field, premium fashion photography, 50mm lens, high dynamic range, neutral realistic color grading, photorealistic, highly detailed, sharp subject, believable urban setting while keeping the character and composition recognizable. Preserve the original garment silhouettes and accessories exactly; avoid changing the character into a different person, avoid cropping the shoes or cap, and keep both hands fully visible."]}, + {"id":82,"type":"ConditioningZeroOut","pos":[720,500],"size":[220,80],"flags":{},"order":8,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":14}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[15]}],"properties":{"Node name for S&R":"ConditioningZeroOut"},"widgets_values":[]}, + {"id":125,"type":"ReferenceLatent","pos":[720,100],"size":[230,100],"flags":{},"order":9,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":14},{"name":"latent","type":"LATENT","link":12}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[16]}],"properties":{"Node name for S&R":"ReferenceLatent"},"widgets_values":[]}, + {"id":123,"type":"ReferenceLatent","pos":[720,650],"size":[230,100],"flags":{},"order":10,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":15},{"name":"latent","type":"LATENT","link":13}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[17]}],"properties":{"Node name for S&R":"ReferenceLatent"},"widgets_values":[]}, + {"id":63,"type":"CFGGuider","pos":[1020,300],"size":[270,160],"flags":{},"order":11,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":2},{"name":"positive","type":"CONDITIONING","link":16},{"name":"negative","type":"CONDITIONING","link":17}],"outputs":[{"name":"GUIDER","type":"GUIDER","links":[18]}],"properties":{"Node name for S&R":"CFGGuider"},"widgets_values":[1.0]}, + {"id":61,"type":"KSamplerSelect","pos":[1020,520],"size":[270,80],"flags":{},"order":12,"mode":0,"inputs":[],"outputs":[{"name":"SAMPLER","type":"SAMPLER","links":[19]}],"properties":{"Node name for S&R":"KSamplerSelect"},"widgets_values":["euler"]}, + {"id":62,"type":"Flux2Scheduler","pos":[1020,650],"size":[270,130],"flags":{},"order":13,"mode":0,"inputs":[{"name":"width","type":"INT","link":8},{"name":"height","type":"INT","link":10}],"outputs":[{"name":"SIGMAS","type":"SIGMAS","links":[20]}],"properties":{"Node name for S&R":"Flux2Scheduler"},"widgets_values":[4,1024,1024]}, + {"id":66,"type":"EmptyFlux2LatentImage","pos":[1320,650],"size":[270,130],"flags":{},"order":14,"mode":0,"inputs":[{"name":"width","type":"INT","link":9},{"name":"height","type":"INT","link":11}],"outputs":[{"name":"LATENT","type":"LATENT","links":[21]}],"properties":{"Node name for S&R":"EmptyFlux2LatentImage"},"widgets_values":[1024,1024,1]}, + {"id":73,"type":"RandomNoise","pos":[1320,260],"size":[270,100],"flags":{},"order":15,"mode":0,"inputs":[],"outputs":[{"name":"NOISE","type":"NOISE","links":[22]}],"properties":{"Node name for S&R":"RandomNoise"},"widgets_values":[20260921,"fixed"]}, + {"id":64,"type":"SamplerCustomAdvanced","pos":[1640,360],"size":[270,190],"flags":{},"order":16,"mode":0,"inputs":[{"name":"noise","type":"NOISE","link":22},{"name":"guider","type":"GUIDER","link":18},{"name":"sampler","type":"SAMPLER","link":19},{"name":"sigmas","type":"SIGMAS","link":20},{"name":"latent_image","type":"LATENT","link":21}],"outputs":[{"name":"output","type":"LATENT","links":[23]},{"name":"denoised_output","type":"LATENT","links":null}],"properties":{"Node name for S&R":"SamplerCustomAdvanced"},"widgets_values":[]}, + {"id":65,"type":"VAEDecode","pos":[1960,380],"size":[230,100],"flags":{},"order":17,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":23},{"name":"vae","type":"VAE","link":5}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[24]}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]}, + {"id":9,"type":"SaveImage","pos":[2250,380],"size":[320,270],"flags":{},"order":18,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":24}],"outputs":[],"properties":{"Node name for S&R":"SaveImage"},"widgets_values":["fluxExperiments/imageEdit/character_photorealistic_preserve_s4_seed20260921"]} + ], + "links":[[1,1,0,80,0,"IMAGE"],[2,70,0,63,0,"MODEL"],[3,71,0,74,0,"CLIP"],[4,72,0,124,1,"VAE"],[5,72,0,65,1,"VAE"],[6,80,0,124,0,"IMAGE"],[7,80,0,99,0,"IMAGE"],[8,99,0,62,0,"INT"],[9,99,0,66,0,"INT"],[10,99,1,62,1,"INT"],[11,99,1,66,1,"INT"],[12,124,0,125,1,"LATENT"],[13,124,0,123,1,"LATENT"],[14,74,0,82,0,"CONDITIONING"],[15,82,0,123,0,"CONDITIONING"],[16,125,0,63,1,"CONDITIONING"],[17,123,0,63,2,"CONDITIONING"],[18,63,0,64,1,"GUIDER"],[19,61,0,64,2,"SAMPLER"],[20,62,0,64,3,"SIGMAS"],[21,66,0,64,4,"LATENT"],[22,73,0,64,0,"NOISE"],[23,64,0,65,0,"LATENT"],[24,65,0,9,0,"IMAGE"]], + "groups":[],"definitions":{"config":{}},"config":{},"extra":{"note":"Flux.2 Klein photorealistic character edit; Euler 4 steps CFG 1.0; seed 20260921"},"version":0.4 +} diff --git a/optimized/image-edit/flux2klein-9b-photorealistic-character/workflow.json b/optimized/image-edit/flux2klein-9b-photorealistic-character/workflow.json new file mode 100644 index 0000000..2f25453 --- /dev/null +++ b/optimized/image-edit/flux2klein-9b-photorealistic-character/workflow.json @@ -0,0 +1,21 @@ +{ + "1": {"class_type":"LoadImage","inputs":{"image":"character_reference.png"}}, + "70": {"class_type":"UNETLoader","inputs":{"unet_name":"flux-2-klein-9b-fp8mixed.safetensors","weight_dtype":"default"}}, + "71": {"class_type":"CLIPLoader","inputs":{"clip_name":"qwen_3_8b_fp8mixed.safetensors","type":"flux2","device":"default"}}, + "72": {"class_type":"VAELoader","inputs":{"vae_name":"full_encoder_small_decoder.safetensors"}}, + "80": {"class_type":"ImageScaleToTotalPixels","inputs":{"image":["1",0],"upscale_method":"nearest-exact","megapixels":1.0,"resolution_steps":1}}, + "99": {"class_type":"GetImageSize","inputs":{"image":["80",0]}}, + "124": {"class_type":"VAEEncode","inputs":{"pixels":["80",0],"vae":["72",0]}}, + "74": {"class_type":"CLIPTextEncode","inputs":{"text":"Transform the provided stylized character illustration into a photorealistic full-body editorial street-fashion photograph of the same adult male character. Preserve the exact identity, facial structure, skin tone, hairstyle, trimmed goatee, round sunglasses, backward purple-and-green baseball cap, gold hoop earring, layered gold chains, purple oversized satin bomber jacket, white graphic T-shirt, loose olive-green cargo pants, white socks and purple-white sneakers, the relaxed confident pose, hand positions, three-quarter stance, full-body framing and outfit color palette. Replace the flat illustrated rendering with natural human skin texture, realistic pores, believable facial anatomy, physically accurate fabric, stitching, metallic jewelry reflections, detailed sneakers, realistic hands and fingers, true-to-life proportions, subtle imperfection, cinematic soft daylight, warm golden-hour key light, gentle directional shadows, shallow but sufficient depth of field, premium fashion photography, 50mm lens, high dynamic range, neutral realistic color grading, photorealistic, highly detailed, sharp subject, believable urban setting while keeping the character and composition recognizable. Preserve the original garment silhouettes and accessories exactly; avoid changing the character into a different person, avoid cropping the shoes or cap, and keep both hands fully visible.","clip":["71",0]}}, + "82": {"class_type":"ConditioningZeroOut","inputs":{"conditioning":["74",0]}}, + "125": {"class_type":"ReferenceLatent","inputs":{"conditioning":["74",0],"latent":["124",0]}}, + "123": {"class_type":"ReferenceLatent","inputs":{"conditioning":["82",0],"latent":["124",0]}}, + "63": {"class_type":"CFGGuider","inputs":{"cfg":1.0,"model":["70",0],"positive":["125",0],"negative":["123",0]}}, + "61": {"class_type":"KSamplerSelect","inputs":{"sampler_name":"euler"}}, + "62": {"class_type":"Flux2Scheduler","inputs":{"steps":4,"width":["99",0],"height":["99",1]}}, + "66": {"class_type":"EmptyFlux2LatentImage","inputs":{"width":["99",0],"height":["99",1],"batch_size":1}}, + "73": {"class_type":"RandomNoise","inputs":{"noise_seed":20260921}}, + "64": {"class_type":"SamplerCustomAdvanced","inputs":{"noise":["73",0],"guider":["63",0],"sampler":["61",0],"sigmas":["62",0],"latent_image":["66",0]}}, + "65": {"class_type":"VAEDecode","inputs":{"samples":["64",0],"vae":["72",0]}}, + "9": {"class_type":"SaveImage","inputs":{"images":["65",0],"filename_prefix":"fluxExperiments/imageEdit/character_photorealistic_preserve_s4_seed20260921"}} +}