Organize optimized workflows by reusable type

This commit is contained in:
Morpheus
2026-09-23 08:47:12 +00:00
parent a321551449
commit 7ff0b7547a
30 changed files with 88 additions and 22 deletions
+3
View File
@@ -0,0 +1,3 @@
# I2I workflows
Use [`flux/`](flux/) or [`qwen/`](qwen/) for one-reference-image transformations. The workflows infer the subject from the input image instead of naming a specific character or scene.
+20
View File
@@ -0,0 +1,20 @@
# Flux.2 Klein — optimized I2I
Converts any supplied reference image into a photorealistic image of the same subject. The prompt is intentionally generic: identity, pose, clothing, accessories, colors, proportions, composition, and framing are inferred from the reference image rather than hard-coded.
## 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.
+26
View File
@@ -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 reference image into a photorealistic image of the same subject. Infer the subject's identity, facial features, skin tone, hairstyle, clothing, accessories, colors, pose, body proportions, hand positions, composition, and framing directly from the reference image. Preserve those inferred visual attributes faithfully while replacing the original rendering style with natural human anatomy, realistic skin and hair texture, physically accurate materials, believable fabric and surface detail, natural hands and fingers, cinematic soft daylight, realistic shadows, coherent perspective, premium editorial photography, 50mm lens, high dynamic range, neutral color grading, photorealistic, highly detailed, sharp subject, and a believable environment appropriate to the reference. Do not redesign, restyle, or substitute the subject. Do not add or remove important clothing, accessories, objects, or body features. Avoid cropping the subject."]},
{"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
}
+21
View File
@@ -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 reference image into a photorealistic image of the same subject. Infer the subject's identity, facial features, skin tone, hairstyle, clothing, accessories, colors, pose, body proportions, hand positions, composition, and framing directly from the reference image. Preserve those inferred visual attributes faithfully while replacing the original rendering style with natural human anatomy, realistic skin and hair texture, physically accurate materials, believable fabric and surface detail, natural hands and fingers, cinematic soft daylight, realistic shadows, coherent perspective, premium editorial photography, 50mm lens, high dynamic range, neutral color grading, photorealistic, highly detailed, sharp subject, and a believable environment appropriate to the reference. Do not redesign, restyle, or substitute the subject. Do not add or remove important clothing, accessories, objects, or body features. Avoid cropping the subject.","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"}}
}
+23
View File
@@ -0,0 +1,23 @@
# Qwen Image 2.1 — optimized I2I
Converts any supplied reference image into a photorealistic image of the same subject. The prompt is generic: identity, pose, clothing, accessories, colors, proportions, composition, and framing are inferred from the input rather than hard-coded.
## Reusable inputs
- `input.png` in node `4` — replace with the reference image.
- Node `7` positive and negative prompts — adapt the transformation without describing a specific subject.
- Node `10` seed — change for alternate results or keep fixed for comparisons.
- Nodes `5` and `14` — change the generation and output dimensions. The default is portrait 1080×1920 for person-focused images.
## Optimization baseline
- Model: `qwen_image_2.1_int8_convrot.safetensors`
- Sampler: Euler CFG++
- Scheduler: beta
- Steps: 40
- CFG: 3.5
- Measured runtime: approximately 81 seconds on the RTX 3070
The workflow uses the installed Qwen Image 2.1 stack and the flattened `images.image_1` reference input required by the API workflow.
- `workflow.json` — API-format workflow.
+17
View File
@@ -0,0 +1,17 @@
{
"1": {"class_type":"UNETLoader","inputs":{"unet_name":"qwen_image_2.1_int8_convrot.safetensors","weight_dtype":"default"}},
"2": {"class_type":"CLIPLoader","inputs":{"clip_name":"qwen3vl_8b_w4a8.safetensors","type":"qwen_image","device":"default"}},
"3": {"class_type":"VAELoader","inputs":{"vae_name":"qwen_image_2.1_vae_bf16.safetensors"}},
"4": {"class_type":"LoadImage","inputs":{"image":"input.png"}},
"5": {"class_type":"ResizeAndPadImage","inputs":{"image":["4",0],"target_width":576,"target_height":1024,"padding_color":"white","interpolation":"lanczos"}},
"6": {"class_type":"QwenImage21Cache","inputs":{"model":["1",0],"device":"auto","dtype":"int8"}},
"7": {"class_type":"TextEncodeQwenImage21","inputs":{"clip":["2",0],"prompt":"Transform the supplied reference image into a photorealistic image of the same subject. Infer identity, facial features, skin tone, hairstyle, clothing, accessories, colors, pose, body proportions, composition, and framing directly from the reference. Preserve those visual attributes faithfully while replacing the original rendering style with natural human anatomy, realistic skin and hair texture, physically accurate materials, believable fabric and surface detail, natural hands and fingers, cinematic soft light, realistic shadows, coherent perspective, premium editorial photography, high dynamic range, photorealistic, highly detailed. Do not redesign, restyle, substitute, add, remove, mirror, or crop the subject. No text or logos.","negative_prompt":"different person, changed identity, changed face, changed hairstyle, changed clothing, changed colors, altered accessories, changed pose, different composition, extra person, duplicate person, extra limbs, malformed hands, fused fingers, distorted anatomy, cropped head, cropped feet, mirrored image, cartoon, illustration, anime, CGI, plastic skin, waxy skin, blurry, low detail, text, logo, watermark","resolution":0,"images.image_1":["5",0],"vae":["3",0]}},
"8": {"class_type":"KSamplerSelect","inputs":{"sampler_name":"euler_cfg_pp"}},
"9": {"class_type":"BasicScheduler","inputs":{"model":["6",0],"scheduler":"beta","steps":40,"denoise":1}},
"10": {"class_type":"RandomNoise","inputs":{"noise_seed":20260921}},
"11": {"class_type":"CFGGuider","inputs":{"model":["6",0],"positive":["7",0],"negative":["7",1],"cfg":3.5}},
"12": {"class_type":"SamplerCustomAdvanced","inputs":{"noise":["10",0],"guider":["11",0],"sampler":["8",0],"sigmas":["9",0],"latent_image":["7",2]}},
"13": {"class_type":"VAEDecode","inputs":{"samples":["12",0],"vae":["3",0]}},
"14": {"class_type":"ResizeAndPadImage","inputs":{"image":["13",0],"target_width":1080,"target_height":1920,"padding_color":"white","interpolation":"lanczos"}},
"15": {"class_type":"SaveImage","inputs":{"images":["14",0],"filename_prefix":"fluxExperiments/imageEdit/qwen_i2i"}}
}