The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Open models: Qwen-Image 2.1 for text to image, edits with up to four references, inpaint and expand
Adarsh73017fe622ff
diff --git a/scripts/comfy/build-library.mjs b/scripts/comfy/build-library.mjsindex 2c077e4d..8bf3aa96 100644--- a/scripts/comfy/build-library.mjs+++ b/scripts/comfy/build-library.mjs@@ -281,7 +281,7 @@ async function main() {}// Every media input must be bound, otherwise the workflow references a template example asset.- const FILE_INPUTS = { LoadImage: 'image', LoadImageMask: 'image', LoadVideo: 'file', VHS_LoadVideo: 'video', LoadAudio: 'audio', VHS_LoadAudioUpload: 'audio' };+ const FILE_INPUTS = { LoadImage: 'image', LoadImageMask: 'image', LoadVideo: 'file', VHS_LoadVideo: 'video', LoadAudio: 'audio', VHS_LoadAudioUpload: 'audio', AUSBOSS_NODES_ImageCropRotatePad: 'image' };const boundTargets = new Set(Object.values(bindings).flat().map((t) => `${t.node}.${t.input}`));for (const [nid, n] of Object.entries(graph)) {const inp = FILE_INPUTS[n.class_type];diff --git a/scripts/comfy/hand-built/qwen-image-21-edit.json b/scripts/comfy/hand-built/qwen-image-21-edit.jsonnew file mode 100644index 00000000..c9ac870a--- /dev/null+++ b/scripts/comfy/hand-built/qwen-image-21-edit.json@@ -0,0 +1,244 @@+{+ "1": {+ "inputs": {+ "unet_name": "qwen_image_2.1_int8_convrot.safetensors",+ "weight_dtype": "default"+ },+ "class_type": "UNETLoader",+ "_meta": {+ "title": "Load Diffusion Model"+ }+ },+ "2": {+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ },+ "class_type": "CLIPLoader",+ "_meta": {+ "title": "Load CLIP (Qwen3-VL 8B)"+ }+ },+ "3": {+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ },+ "class_type": "VAELoader",+ "_meta": {+ "title": "Load VAE"+ }+ },+ "10": {+ "inputs": {+ "image": "image_1.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image (image 1)"+ }+ },+ "11": {+ "inputs": {+ "image": "image_2.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image (image 2)"+ }+ },+ "12": {+ "inputs": {+ "image": "image_3.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image (image 3)"+ }+ },+ "13": {+ "inputs": {+ "image": "image_4.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image (image 4)"+ }+ },+ "20": {+ "inputs": {+ "upscale_method": "lanczos",+ "largest_size": 2048,+ "image": [+ "10",+ 0+ ]+ },+ "class_type": "ImageScaleToMaxDimension",+ "_meta": {+ "title": "Scale image 1 to 2048"+ }+ },+ "21": {+ "inputs": {+ "upscale_method": "lanczos",+ "largest_size": 2048,+ "image": [+ "11",+ 0+ ]+ },+ "class_type": "ImageScaleToMaxDimension",+ "_meta": {+ "title": "Scale image 2 to 2048"+ }+ },+ "22": {+ "inputs": {+ "upscale_method": "lanczos",+ "largest_size": 2048,+ "image": [+ "12",+ 0+ ]+ },+ "class_type": "ImageScaleToMaxDimension",+ "_meta": {+ "title": "Scale image 3 to 2048"+ }+ },+ "23": {+ "inputs": {+ "upscale_method": "lanczos",+ "largest_size": 2048,+ "image": [+ "13",+ 0+ ]+ },+ "class_type": "ImageScaleToMaxDimension",+ "_meta": {+ "title": "Scale image 4 to 2048"+ }+ },+ "30": {+ "inputs": {+ "prompt": "",+ "negative_prompt": "",+ "resolution": 0,+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "3",+ 0+ ],+ "images.image_1": [+ "20",+ 0+ ],+ "images.image_2": [+ "21",+ 0+ ],+ "images.image_3": [+ "22",+ 0+ ],+ "images.image_4": [+ "23",+ 0+ ]+ },+ "class_type": "TextEncodeQwenImage21",+ "_meta": {+ "title": "Text Encode Qwen Image 2.1 (references)"+ }+ },+ "31": {+ "inputs": {+ "device": "auto",+ "dtype": "default",+ "model": [+ "1",+ 0+ ]+ },+ "class_type": "QwenImage21Cache",+ "_meta": {+ "title": "Qwen Image 2.1 Cache"+ }+ },+ "32": {+ "inputs": {+ "seed": 0,+ "steps": 25,+ "cfg": 1,+ "sampler_name": "euler",+ "scheduler": "simple",+ "denoise": 1,+ "model": [+ "31",+ 0+ ],+ "positive": [+ "30",+ 0+ ],+ "negative": [+ "30",+ 1+ ],+ "latent_image": [+ "30",+ 2+ ]+ },+ "class_type": "KSampler",+ "_meta": {+ "title": "KSampler"+ }+ },+ "33": {+ "inputs": {+ "samples": [+ "32",+ 0+ ],+ "vae": [+ "3",+ 0+ ]+ },+ "class_type": "VAEDecode",+ "_meta": {+ "title": "VAE Decode"+ }+ },+ "34": {+ "inputs": {+ "image": [+ "33",+ 0+ ]+ },+ "class_type": "SplitImageWithAlpha",+ "_meta": {+ "title": "Drop the alpha"+ }+ },+ "90": {+ "inputs": {+ "filename_prefix": "fuobe/qwen-image-21-edit",+ "images": [+ "34",+ 0+ ]+ },+ "class_type": "SaveImage",+ "_meta": {+ "title": "Save Image"+ }+ }+}diff --git a/scripts/comfy/hand-built/qwen-image-21-inpaint.json b/scripts/comfy/hand-built/qwen-image-21-inpaint.jsonnew file mode 100644index 00000000..2bb4f10e--- /dev/null+++ b/scripts/comfy/hand-built/qwen-image-21-inpaint.json@@ -0,0 +1,269 @@+{+ "1": {+ "inputs": {+ "unet_name": "qwen_image_2.1_int8_convrot.safetensors",+ "weight_dtype": "default"+ },+ "class_type": "UNETLoader",+ "_meta": {+ "title": "Load Diffusion Model"+ }+ },+ "2": {+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ },+ "class_type": "CLIPLoader",+ "_meta": {+ "title": "Load CLIP (Qwen3-VL 8B)"+ }+ },+ "3": {+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ },+ "class_type": "VAELoader",+ "_meta": {+ "title": "Load VAE"+ }+ },+ "10": {+ "inputs": {+ "image": "image.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image"+ }+ },+ "11": {+ "inputs": {+ "image": "mask.png",+ "channel": "red"+ },+ "class_type": "LoadImageMask",+ "_meta": {+ "title": "Load Mask (white = change)"+ }+ },+ "20": {+ "inputs": {+ "context_factor": 1.6,+ "blend_pixels": 8,+ "output_multiple": 32,+ "target_width": 0,+ "target_height": 0,+ "mask_grow": 0,+ "mask_blur": 0,+ "invert_mask": false,+ "context_pixels": 0,+ "target_megapixels": 1.5,+ "rescale_algorithm": "bicubic",+ "extend_left": 0,+ "extend_right": 0,+ "extend_up": 0,+ "extend_down": 0,+ "keep_inside": true,+ "image": [+ "10",+ 0+ ],+ "mask": [+ "11",+ 0+ ]+ },+ "class_type": "AUSBOSS_NODES_CropForInpaint",+ "_meta": {+ "title": "Crop For Inpaint - Crop around the painted part"+ }+ },+ "21": {+ "inputs": {+ "expand": 8,+ "tapered_corners": true,+ "mask": [+ "20",+ 1+ ]+ },+ "class_type": "GrowMask",+ "_meta": {+ "title": "Grow Mask - A little past the painted part"+ }+ },+ "22": {+ "inputs": {+ "f_string": "{a} Keep everything else exactly the same.",+ "values.a": ""+ },+ "class_type": "StringFormat",+ "_meta": {+ "title": "Format Text - Your request, and keep the rest"+ }+ },+ "23": {+ "inputs": {+ "negative_prompt": "",+ "resolution": 0,+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "3",+ 0+ ],+ "prompt": [+ "22",+ 0+ ],+ "images.image_1": [+ "20",+ 0+ ]+ },+ "class_type": "TextEncodeQwenImage21",+ "_meta": {+ "title": "Text Encode Qwen Image 2.1 - The crop and your request"+ }+ },+ "24": {+ "inputs": {+ "pixels": [+ "20",+ 0+ ],+ "vae": [+ "3",+ 0+ ]+ },+ "class_type": "VAEEncode",+ "_meta": {+ "title": "VAE Encode - The crop as the starting point"+ }+ },+ "25": {+ "inputs": {+ "samples": [+ "24",+ 0+ ],+ "mask": [+ "21",+ 0+ ]+ },+ "class_type": "SetLatentNoiseMask",+ "_meta": {+ "title": "Set Latent Noise Mask - Only the painted part may change"+ }+ },+ "26": {+ "inputs": {+ "device": "auto",+ "dtype": "default",+ "model": [+ "1",+ 0+ ]+ },+ "class_type": "QwenImage21Cache",+ "_meta": {+ "title": "Reference cache"+ }+ },+ "27": {+ "inputs": {+ "seed": 0,+ "steps": 25,+ "cfg": 1,+ "sampler_name": "euler",+ "scheduler": "simple",+ "denoise": 1,+ "model": [+ "26",+ 0+ ],+ "positive": [+ "23",+ 0+ ],+ "negative": [+ "23",+ 1+ ],+ "latent_image": [+ "25",+ 0+ ]+ },+ "class_type": "KSampler",+ "_meta": {+ "title": "Sampler - CFG 1, euler"+ }+ },+ "28": {+ "inputs": {+ "samples": [+ "27",+ 0+ ],+ "vae": [+ "3",+ 0+ ]+ },+ "class_type": "VAEDecode",+ "_meta": {+ "title": "Decode"+ }+ },+ "29": {+ "inputs": {+ "image": [+ "28",+ 0+ ]+ },+ "class_type": "SplitImageWithAlpha",+ "_meta": {+ "title": "Drop the alpha"+ }+ },+ "30": {+ "inputs": {+ "fix_edge_halo": false,+ "color_match": 0,+ "seam": "classic",+ "stitcher": [+ "20",+ 2+ ],+ "inpainted": [+ "29",+ 0+ ]+ },+ "class_type": "AUSBOSS_NODES_StitchInpaint",+ "_meta": {+ "title": "Stitch Inpaint - Put the new part back"+ }+ },+ "90": {+ "inputs": {+ "filename_prefix": "fuobe/qwen-image-21-inpaint",+ "images": [+ "30",+ 0+ ]+ },+ "class_type": "SaveImage",+ "_meta": {+ "title": "Save Image"+ }+ }+}diff --git a/scripts/comfy/hand-built/qwen-image-21-outpaint.json b/scripts/comfy/hand-built/qwen-image-21-outpaint.jsonnew file mode 100644index 00000000..f1e00dc3--- /dev/null+++ b/scripts/comfy/hand-built/qwen-image-21-outpaint.json@@ -0,0 +1,408 @@+{+ "1": {+ "inputs": {+ "unet_name": "qwen_image_2.1_int8_convrot.safetensors",+ "weight_dtype": "default"+ },+ "class_type": "UNETLoader",+ "_meta": {+ "title": "Load Diffusion Model"+ }+ },+ "2": {+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ },+ "class_type": "CLIPLoader",+ "_meta": {+ "title": "Load CLIP (Qwen3-VL 8B)"+ }+ },+ "3": {+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ },+ "class_type": "VAELoader",+ "_meta": {+ "title": "Load VAE"+ }+ },+ "4": {+ "inputs": {+ "model": [+ "1",+ 0+ ],+ "lora_name": "qwen-image-2.1-outpaint-v2.safetensors",+ "strength_model": 1+ },+ "class_type": "LoraLoaderModelOnly",+ "_meta": {+ "title": "Outpaint LoRA"+ }+ },+ "10": {+ "inputs": {+ "image": "image.png",+ "rotation_degrees": 0,+ "crop_aspect_ratio": "free",+ "crop_x": 0,+ "crop_y": 0,+ "crop_width": 0,+ "crop_height": 0,+ "pad_left": 384,+ "pad_top": 288,+ "pad_right": 384,+ "pad_bottom": 288,+ "feather": 12,+ "canvas_multiple": 1,+ "fill_color": "#808080",+ "resize_to_megapixels": true,+ "megapixels": 1,+ "resize_method": "lanczos",+ "resolution_steps": 32,+ "stitch_blend": 0,+ "stitch_grow": 0+ },+ "class_type": "AUSBOSS_NODES_ImageCropRotatePad",+ "_meta": {+ "title": "Image Crop + Rotate + Pad - Your image on the gray canvas (1 MP)"+ }+ },+ "11": {+ "inputs": {+ "image": "image.png",+ "rotation_degrees": 0,+ "crop_aspect_ratio": "free",+ "crop_x": 0,+ "crop_y": 0,+ "crop_width": 0,+ "crop_height": 0,+ "pad_left": 384,+ "pad_top": 288,+ "pad_right": 384,+ "pad_bottom": 288,+ "feather": 48,+ "canvas_multiple": 1,+ "fill_color": "#808080",+ "resize_to_megapixels": false,+ "megapixels": 1,+ "resize_method": "lanczos",+ "resolution_steps": 32,+ "stitch_blend": 0,+ "stitch_grow": 0+ },+ "class_type": "AUSBOSS_NODES_ImageCropRotatePad",+ "_meta": {+ "title": "Image Crop + Rotate + Pad - Your image at full size"+ }+ },+ "20": {+ "inputs": {+ "image": [+ "10",+ 6+ ],+ "mask": [+ "10",+ 1+ ],+ "context_factor": 1,+ "blend_pixels": 0,+ "output_multiple": 1,+ "target_width": 0,+ "target_height": 0,+ "mask_grow": 0,+ "mask_blur": 0,+ "invert_mask": true,+ "context_pixels": 0,+ "target_megapixels": 0,+ "rescale_algorithm": "bilinear",+ "extend_left": 0,+ "extend_right": 0,+ "extend_up": 0,+ "extend_down": 0,+ "keep_inside": true+ },+ "class_type": "AUSBOSS_NODES_CropForInpaint",+ "_meta": {+ "title": "Crop For Inpaint - Your picture, see-through parts filled"+ }+ },+ "21": {+ "inputs": {+ "string": "",+ "regex_pattern": "^\\s*(?:also include in the prompt\\s*:?\\s*)?",+ "replace": "Also include in the prompt: ",+ "case_insensitive": true,+ "multiline": false,+ "dotall": false,+ "count": 1+ },+ "class_type": "RegexReplace",+ "_meta": {+ "title": "Add the lead-in if it's missing"+ }+ },+ "22": {+ "inputs": {+ "string_a": "Write the text-to-image prompt that would generate this exact picture. One paragraph of 50 to 90 words. Begin with the medium and style in a few words, such as \"Photograph\", \"Smartphone photo\", \"Anime illustration\", \"Oil painting\" or \"3D render\". Then describe the subject, the setting, and what fills every part of the frame from edge to edge, including the background and the areas near the borders. Any flat mid-gray parts, such as corners or a background, are blank space that will be painted to continue the scene: describe the scene as if it filled the whole frame, and don't describe a border, frame or vignette around it. Include materials, colours, lighting, time of day, camera angle and framing. Quote any readable text exactly. Use plain factual language; do not start with 'The image' or 'This picture' and do not give opinions. Output only the prompt.",+ "string_b": [+ "21",+ 0+ ],+ "delimiter": " "+ },+ "class_type": "StringConcatenate",+ "_meta": {+ "title": "Instruction plus what goes there"+ }+ },+ "23": {+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "image": [+ "20",+ 0+ ],+ "prompt": [+ "22",+ 0+ ],+ "max_length": 300,+ "sampling_mode": "on",+ "sampling_mode.temperature": 0.3,+ "sampling_mode.top_k": 64,+ "sampling_mode.top_p": 0.95,+ "sampling_mode.min_p": 0.05,+ "sampling_mode.repetition_penalty": 1.05,+ "sampling_mode.seed": 20260925,+ "sampling_mode.presence_penalty": 0,+ "thinking": false,+ "use_default_template": true,+ "mtp": "auto"+ },+ "class_type": "TextGenerate",+ "_meta": {+ "title": "Describe the picture"+ }+ },+ "24": {+ "inputs": {+ "string_a": "Outpaint the image: replace the solid gray areas with a seamless continuation of the scene, keeping the existing picture unchanged.",+ "string_b": [+ "23",+ 0+ ],+ "delimiter": " Scene: "+ },+ "class_type": "StringConcatenate",+ "_meta": {+ "title": "Outpaint instruction plus description"+ }+ },+ "30": {+ "inputs": {+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "3",+ 0+ ],+ "prompt": [+ "24",+ 0+ ],+ "negative_prompt": "",+ "resolution": 0,+ "images.image_1": [+ "10",+ 0+ ]+ },+ "class_type": "TextEncodeQwenImage21",+ "_meta": {+ "title": "Text Encode Qwen Image 2.1 - Prompt and canvas"+ }+ },+ "31": {+ "inputs": {+ "model": [+ "4",+ 0+ ],+ "device": "auto",+ "dtype": "default"+ },+ "class_type": "QwenImage21Cache",+ "_meta": {+ "title": "Reference cache"+ }+ },+ "32": {+ "inputs": {+ "model": [+ "31",+ 0+ ],+ "positive": [+ "30",+ 0+ ],+ "negative": [+ "30",+ 1+ ],+ "latent_image": [+ "30",+ 2+ ],+ "seed": 0,+ "steps": 25,+ "cfg": 1,+ "sampler_name": "euler",+ "scheduler": "simple",+ "denoise": 1+ },+ "class_type": "KSampler",+ "_meta": {+ "title": "Qwen 2.1 sampler"+ }+ },+ "33": {+ "inputs": {+ "samples": [+ "32",+ 0+ ],+ "vae": [+ "3",+ 0+ ]+ },+ "class_type": "VAEDecode",+ "_meta": {+ "title": "Decode"+ }+ },+ "34": {+ "inputs": {+ "image": [+ "33",+ 0+ ]+ },+ "class_type": "SplitImageWithAlpha",+ "_meta": {+ "title": "Drop the alpha"+ }+ },+ "35": {+ "inputs": {+ "stitcher": [+ "10",+ 2+ ],+ "inpainted": [+ "34",+ 0+ ],+ "fix_edge_halo": false,+ "color_match": 1,+ "seam": "blend in"+ },+ "class_type": "AUSBOSS_NODES_StitchInpaint",+ "_meta": {+ "title": "Stitch Inpaint - Put the new part back"+ }+ },+ "40": {+ "inputs": {+ "image": [+ "11",+ 0+ ]+ },+ "class_type": "GetImageSize",+ "_meta": {+ "title": "Full-size canvas"+ }+ },+ "41": {+ "inputs": {+ "image": [+ "35",+ 0+ ],+ "upscale_method": "lanczos",+ "width": [+ "40",+ 0+ ],+ "height": [+ "40",+ 1+ ],+ "crop": "disabled"+ },+ "class_type": "ImageScale",+ "_meta": {+ "title": "Scale to the full-size canvas"+ }+ },+ "42": {+ "inputs": {+ "mask": [+ "11",+ 1+ ]+ },+ "class_type": "InvertMask",+ "_meta": {+ "title": "Where your image is"+ }+ },+ "43": {+ "inputs": {+ "destination": [+ "41",+ 0+ ],+ "source": [+ "11",+ 0+ ],+ "x": 0,+ "y": 0,+ "resize_source": false,+ "mask": [+ "42",+ 0+ ]+ },+ "class_type": "ImageCompositeMasked",+ "_meta": {+ "title": "Your image back on top"+ }+ },+ "90": {+ "inputs": {+ "filename_prefix": "fuobe/qwen-image-21-outpaint",+ "images": [+ "43",+ 0+ ]+ },+ "class_type": "SaveImage",+ "_meta": {+ "title": "Save Image"+ }+ }+}diff --git a/scripts/comfy/hand-built/qwen-image-21-t2i.json b/scripts/comfy/hand-built/qwen-image-21-t2i.jsonnew file mode 100644index 00000000..f67ebbfd--- /dev/null+++ b/scripts/comfy/hand-built/qwen-image-21-t2i.json@@ -0,0 +1,129 @@+{+ "1": {+ "inputs": {+ "unet_name": "qwen_image_2.1_int8_convrot.safetensors",+ "weight_dtype": "default"+ },+ "class_type": "UNETLoader",+ "_meta": {+ "title": "Load Diffusion Model"+ }+ },+ "2": {+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ },+ "class_type": "CLIPLoader",+ "_meta": {+ "title": "Load CLIP (Qwen3-VL 8B)"+ }+ },+ "3": {+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ },+ "class_type": "VAELoader",+ "_meta": {+ "title": "Load VAE"+ }+ },+ "4": {+ "inputs": {+ "prompt": "",+ "negative_prompt": "",+ "resolution": 1024,+ "clip": [+ "2",+ 0+ ]+ },+ "class_type": "TextEncodeQwenImage21",+ "_meta": {+ "title": "Text Encode Qwen Image 2.1"+ }+ },+ "5": {+ "inputs": {+ "width": 1024,+ "height": 1024,+ "batch_size": 1+ },+ "class_type": "EmptyLatentImage",+ "_meta": {+ "title": "Empty Latent Image"+ }+ },+ "6": {+ "inputs": {+ "seed": 0,+ "steps": 25,+ "cfg": 1,+ "sampler_name": "euler",+ "scheduler": "simple",+ "denoise": 1,+ "model": [+ "1",+ 0+ ],+ "positive": [+ "4",+ 0+ ],+ "negative": [+ "4",+ 1+ ],+ "latent_image": [+ "5",+ 0+ ]+ },+ "class_type": "KSampler",+ "_meta": {+ "title": "KSampler"+ }+ },+ "7": {+ "inputs": {+ "samples": [+ "6",+ 0+ ],+ "vae": [+ "3",+ 0+ ]+ },+ "class_type": "VAEDecode",+ "_meta": {+ "title": "VAE Decode"+ }+ },+ "8": {+ "inputs": {+ "image": [+ "7",+ 0+ ]+ },+ "class_type": "SplitImageWithAlpha",+ "_meta": {+ "title": "Drop the alpha"+ }+ },+ "9": {+ "inputs": {+ "filename_prefix": "fuobe/qwen-image-21-t2i",+ "images": [+ "8",+ 0+ ]+ },+ "class_type": "SaveImage",+ "_meta": {+ "title": "Save Image"+ }+ }+}diff --git a/scripts/comfy/hand-built/qwen-image-21-turbo-edit.json b/scripts/comfy/hand-built/qwen-image-21-turbo-edit.jsonnew file mode 100644index 00000000..3198fbe9--- /dev/null+++ b/scripts/comfy/hand-built/qwen-image-21-turbo-edit.json@@ -0,0 +1,290 @@+{+ "1": {+ "inputs": {+ "unet_name": "qwen_image_2.1_turbo_int8_convrot.safetensors",+ "weight_dtype": "default"+ },+ "class_type": "UNETLoader",+ "_meta": {+ "title": "Load Diffusion Model"+ }+ },+ "2": {+ "inputs": {+ "clip_name": "qwen3vl_8b_int8_convrot.safetensors",+ "type": "qwen_image",+ "device": "default"+ },+ "class_type": "CLIPLoader",+ "_meta": {+ "title": "Load CLIP (Qwen3-VL 8B)"+ }+ },+ "3": {+ "inputs": {+ "vae_name": "qwen_image_2.1_vae_bf16.safetensors"+ },+ "class_type": "VAELoader",+ "_meta": {+ "title": "Load VAE"+ }+ },+ "10": {+ "inputs": {+ "image": "image_1.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image (image 1)"+ }+ },+ "11": {+ "inputs": {+ "image": "image_2.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image (image 2)"+ }+ },+ "12": {+ "inputs": {+ "image": "image_3.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image (image 3)"+ }+ },+ "13": {+ "inputs": {+ "image": "image_4.png"+ },+ "class_type": "LoadImage",+ "_meta": {+ "title": "Load Image (image 4)"+ }+ },+ "20": {+ "inputs": {+ "upscale_method": "lanczos",+ "largest_size": 2048,+ "image": [+ "10",+ 0+ ]+ },+ "class_type": "ImageScaleToMaxDimension",+ "_meta": {+ "title": "Scale image 1 to 2048"+ }+ },+ "21": {+ "inputs": {+ "upscale_method": "lanczos",+ "largest_size": 2048,+ "image": [+ "11",+ 0+ ]+ },+ "class_type": "ImageScaleToMaxDimension",+ "_meta": {+ "title": "Scale image 2 to 2048"+ }+ },+ "22": {+ "inputs": {+ "upscale_method": "lanczos",+ "largest_size": 2048,+ "image": [+ "12",+ 0+ ]+ },+ "class_type": "ImageScaleToMaxDimension",+ "_meta": {+ "title": "Scale image 3 to 2048"+ }+ },+ "23": {+ "inputs": {+ "upscale_method": "lanczos",+ "largest_size": 2048,+ "image": [+ "13",+ 0+ ]+ },+ "class_type": "ImageScaleToMaxDimension",+ "_meta": {+ "title": "Scale image 4 to 2048"+ }+ },+ "30": {+ "inputs": {+ "prompt": "",+ "negative_prompt": "",+ "resolution": 0,+ "clip": [+ "2",+ 0+ ],+ "vae": [+ "3",+ 0+ ],+ "images.image_1": [+ "20",+ 0+ ],+ "images.image_2": [+ "21",+ 0+ ],+ "images.image_3": [+ "22",+ 0+ ],+ "images.image_4": [+ "23",+ 0+ ]+ },+ "class_type": "TextEncodeQwenImage21",+ "_meta": {+ "title": "Text Encode Qwen Image 2.1 (references)"+ }+ },+ "31": {+ "inputs": {+ "device": "auto",+ "dtype": "default",+ "model": [+ "1",+ 0+ ]+ },+ "class_type": "QwenImage21Cache",+ "_meta": {+ "title": "Qwen Image 2.1 Cache"+ }+ },+ "32": {+ "inputs": {+ "noise": [+ "70",+ 0+ ],+ "guider": [+ "71",+ 0+ ],+ "sampler": [+ "72",+ 0+ ],+ "sigmas": [+ "73",+ 0+ ],+ "latent_image": [+ "30",+ 2+ ]+ },+ "class_type": "SamplerCustomAdvanced",+ "_meta": {+ "title": "Sampler Custom Advanced"+ }+ },+ "33": {+ "inputs": {+ "samples": [+ "32",+ 0+ ],+ "vae": [+ "3",+ 0+ ]+ },+ "class_type": "VAEDecode",+ "_meta": {+ "title": "VAE Decode"+ }+ },+ "34": {+ "inputs": {+ "image": [+ "33",+ 0+ ]+ },+ "class_type": "SplitImageWithAlpha",+ "_meta": {+ "title": "Drop the alpha"+ }+ },+ "70": {+ "inputs": {+ "noise_seed": 0+ },+ "class_type": "RandomNoise",+ "_meta": {+ "title": "Random Noise"+ }+ },+ "71": {+ "inputs": {+ "cfg": 1,+ "model": [+ "31",+ 0+ ],+ "positive": [+ "30",+ 0+ ],+ "negative": [+ "30",+ 1+ ]+ },+ "class_type": "CFGGuider",+ "_meta": {+ "title": "CFG Guider"+ }+ },+ "72": {+ "inputs": {+ "sampler_name": "euler"+ },+ "class_type": "KSamplerSelect",+ "_meta": {+ "title": "KSampler Select (euler)"+ }+ },+ "73": {+ "inputs": {+ "sigmas": "1.0, 0.978453, 0.95418, 0.926626, 0.89508, 0.845148, 0.704534, 0.414568, 0"+ },+ "class_type": "ManualSigmas",+ "_meta": {+ "title": "Manual Sigmas (Qwen-Image-2.1-Turbo 8-step schedule)"+ }+ },+ "90": {+ "inputs": {+ "filename_prefix": "fuobe/qwen-image-21-turbo-edit",+ "images": [+ "34",+ 0+ ]+ },+ "class_type": "SaveImage",+ "_meta": {+ "title": "Save Image"+ }+ }+}diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjsindex 444f1ddb..4153efb7 100644--- a/scripts/comfy/library.spec.mjs+++ b/scripts/comfy/library.spec.mjs@@ -138,6 +138,8 @@ export const CUSTOM_NODE_REPOS = {// validation server (entries list them with `packs`); install-comfyui.sh pins both.h3_character_swap: 'https://github.com/akatz-labs/h3-character-swap-tool/tree/0670e4fdf95adf2262caa4b81afed2a9c4ae4b7b/worker_nodes/h3_character_swap','h3-relay': 'https://github.com/akatz-ai/h3-relay/tree/e2a7665b6eb8ea37a88c0de2c9c6b69a8f7c9220',+ // Owner's SOTA image families (2026-10-31): AusBoss's crop, pad and stitch nodes (Qwen-Image 2.1 inpaint and expand), MIT.+ 'ausboss-nodes': 'https://github.com/ausboss/ComfyUI-AusBoss',};// Node classes of the packs entries list in `packs` (packs the validation server doesn't have installed): the build@@ -145,6 +147,7 @@ export const CUSTOM_NODE_REPOS = {export const PACK_CLASSES = {h3_character_swap: /^H3CharacterSwap/,'h3-relay': /^(H3Relay|LabsH3)/,+ 'ausboss-nodes': /^AUSBOSS_NODES_/,};// Model download locations for files that the source workflow does not annotate@@ -264,6 +267,12 @@ export const KNOWN_MODELS = {// round 4 (r4/video-finish): the chunked SeedVR2 graph is hand-built, so its files are named here (same files as the template).'seedvr2_3b_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/Comfy-Org/SeedVR2/resolve/main/diffusion_models/seedvr2_3b_int8_convrot.safetensors' },'seedvr2_ema_vae_fp16.safetensors': { folder: 'vae', url: 'https://huggingface.co/Comfy-Org/SeedVR2/resolve/main/vae/seedvr2_ema_vae_fp16.safetensors' },+ // owner's SOTA families (2026-10-31): Qwen-Image 2.1. `variants`: the same weights in another precision in the same repo.+ 'qwen_image_2.1_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors', variants: ['qwen_image_2.1_bf16.safetensors'] },+ 'qwen_image_2.1_turbo_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_turbo_int8_convrot.safetensors', variants: ['qwen_image_2.1_turbo_bf16.safetensors'] },+ 'qwen3vl_8b_int8_convrot.safetensors': { folder: 'text_encoders', url: 'https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors', variants: ['qwen3vl_8b_bf16.safetensors'] },+ 'qwen_image_2.1_vae_bf16.safetensors': { folder: 'vae', url: 'https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors' },+ 'qwen-image-2.1-outpaint-v2.safetensors': { folder: 'loras', url: 'https://huggingface.co/ausboss/Qwen-Image-2.1-Outpaint-LoRA/resolve/main/qwen-image-2.1-outpaint-v2.safetensors' },};const WAN_NEG_EN =@@ -2111,6 +2120,109 @@ export const SPEC = ['The look\'s LoRAs are injected after the UNETLoader (LoraLoaderModelOnly), as on z-image-turbo-t2i. The result keeps the picture\'s shape.',},+ // ---- Owner's SOTA image families: Qwen-Image 2.1 (2026-10-31) ------------------------+ // Core ComfyUI 0.42.0 nodes (TextEncodeQwenImage21, QwenImage21Cache); inpaint and expand also need the AusBoss nodes.+ // The Qwen 2.1 VAE decodes four channels, so every graph drops the alpha (SplitImageWithAlpha) before saving or stitching.+ {+ id: 'qwen-image-21-t2i',+ title: 'Qwen-Image 2.1 Text to Image',+ capability: 't2i',+ handBuilt: 'hand-built/qwen-image-21-t2i.json',+ bindings: {+ prompt: [b('4', 'prompt')], width: [b('5', 'width')], height: [b('5', 'height')], seed: [b('6', 'seed')], steps: [b('6', 'steps')],+ },+ outputs: [{ node: '9', kind: 'image' }],+ limits: { maxWidth: 2048, maxHeight: 2048, dimensionMultiple: 32 },+ vramGb: 20,+ license: 'Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only',+ notes:+ 'The owner\'s image_qwen_image_2_1_t2i-working-great-default.json, its subgraph flattened: int8 model, Qwen3-VL 8B int8 text encoder (type qwen_image), ' ++ 'TextEncodeQwenImage21 (no negative, resolution 1024, no images), EmptyLatentImage, KSampler 25 steps, cfg 1, euler, simple, denoise 1 (as saved). ' ++ 'Removed: the ResolutionSelector (width/height bind the latent, multiples of 32 as the owner\'s note asks, native up to 2048x2048) and the SaveImageAdvanced (SaveImage after SplitImageWithAlpha). ' ++ 'cfg 1: no negative prompt. Proof [O]: the owner\'s saved workflow; not rendered through Fuobe yet.',+ },+ {+ id: 'qwen-image-21-edit',+ title: 'Qwen-Image 2.1 Image Edit (up to 4 references)',+ capability: 'edit',+ handBuilt: 'hand-built/qwen-image-21-edit.json',+ bindings: {+ prompt: [b('30', 'prompt')], image: [b('10', 'image')], image2: [b('11', 'image')], image3: [b('12', 'image')], image4: [b('13', 'image')],+ seed: [b('32', 'seed')], steps: [b('32', 'steps')],+ },+ outputs: [{ node: '90', kind: 'image' }],+ limits: { maxWidth: 2048, maxHeight: 2048 },+ vramGb: 20,+ license: 'Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only',+ notes:+ 'The proven preview graph qwen21-edit-25 (FashDash\'s 25-step camera_q21 stage) with the references wired as the owner\'s image_qwen_image_2_1_image_edit.json / homecenter graph: ' ++ 'each image scaled to 2048 on its long side (lanczos), all of them on one TextEncodeQwenImage21 (images.image_1..4, resolution 0 = each at its own size on the 32 grid, vae linked, no negative), ' ++ 'its latent (image 1\'s size: no custom-size latent, which shifts the edit), QwenImage21Cache auto, KSampler 25 steps, cfg 1, euler, simple. Output follows image 1 (2048 on the long side). ' ++ 'Images 2-4 are optional: the provider drops a reference not given (dropBranch into TextEncodeQwenImage21). Prompt: one plain instruction, then one keep clause pointing at the picture ' ++ '("Keep ... exactly as in image 1"); refer to references as image 1/2/3/4. Removed: the ComfySwitchNode custom size, compare and note nodes. Proof [P]: 133 preview edits (qwen21-edit-25 and turbo).',+ },+ {+ id: 'qwen-image-21-turbo-edit',+ title: 'Qwen-Image 2.1 Turbo Image Edit (8 steps, up to 4 references)',+ capability: 'edit',+ handBuilt: 'hand-built/qwen-image-21-turbo-edit.json',+ bindings: {+ prompt: [b('30', 'prompt')], image: [b('10', 'image')], image2: [b('11', 'image')], image3: [b('12', 'image')], image4: [b('13', 'image')], seed: [b('70', 'noise_seed')],+ },+ outputs: [{ node: '90', kind: 'image' }],+ limits: { maxWidth: 2048, maxHeight: 2048 },+ vramGb: 20,+ license: 'Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only',+ notes:+ 'The owner\'s image_qwen_image_2_1_turbo_image_edit.json as the proven preview graphs qwen21-edit-fast / qwen21-edit-fast-2img run it: turbo int8 model, the fixed 8-step ManualSigmas ' ++ 'schedule, KSamplerSelect euler, CFGGuider cfg 1, RandomNoise, SamplerCustomAdvanced on the encoder\'s latent; references as qwen-image-21-edit (2048 lanczos, resolution 0, up to 4, optional ones dropped). ' ++ 'No steps binding: the sigmas are the schedule. Removed: the prompt enhancer branch (Qwen3.5 9B PE model, off in the owner\'s template), the custom-size switch, compare and notes. ' ++ 'FashDash\'s blind test: as good as 25 steps (dressing 21 vs 22 of 48), weaker only on hard camera turns and product rotations (use qwen-image-21-edit there). Proof [P]: the preview end images.',+ },+ {+ id: 'qwen-image-21-inpaint',+ title: 'Qwen-Image 2.1 Inpaint (crop around the mask, paste back)',+ capability: 'inpaint',+ handBuilt: 'hand-built/qwen-image-21-inpaint.json',+ bindings: {+ prompt: [b('22', 'values.a')], image: [b('10', 'image')], mask: [b('11', 'image')], seed: [b('27', 'seed')], steps: [b('27', 'steps')],+ },+ outputs: [{ node: '90', kind: 'image' }],+ vramGb: 20,+ license: 'Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; AusBoss nodes MIT',+ notes:+ 'The AusBoss pack\'s example "Qwen Image 2.1 Inpaint (AusBoss)" (the only Qwen 2.1 inpaint recipe on the owner\'s PC; not one of the owner\'s saved workflows), its two subgraphs flattened: ' ++ 'Crop For Inpaint (context 1.6, blend 8 px, multiple 32, 1.5 MP, bicubic) -> GrowMask 8 on the crop\'s mask -> StringFormat "{a} Keep everything else exactly the same." -> ' ++ 'TextEncodeQwenImage21 with the crop as image 1 (resolution 0) -> VAEEncode of the crop + SetLatentNoiseMask -> QwenImage21Cache -> KSampler 25 steps, cfg 1, euler, simple -> ' ++ 'SplitImageWithAlpha -> Stitch Inpaint (classic, no colour match) back into the full picture. mask = separate uploaded PNG, same size as image, read from the RED channel: white = change ' ++ '(as flux1-fill-inpaint). Removed: Mask by Touch and its SAM 3.1 model (the mask is uploaded), the speed LoRA (off as saved), the crop/pad loader (LoadImage), compare, timer and notes. ' ++ 'Prompt: say what goes in the painted area like asking a person ("Replace the cup with a glass of orange juice"). Proof [I]: not rendered yet.',+ },+ {+ id: 'qwen-image-21-outpaint',+ title: 'Qwen-Image 2.1 Expand (outpaint-v2 LoRA, Qwen3-VL scene description)',+ capability: 'outpaint',+ handBuilt: 'hand-built/qwen-image-21-outpaint.json',+ bindings: {+ prompt: [b('21', 'string')], image: [b('10', 'image'), b('11', 'image')],+ padLeft: [b('10', 'pad_left'), b('11', 'pad_left')], padTop: [b('10', 'pad_top'), b('11', 'pad_top')],+ padRight: [b('10', 'pad_right'), b('11', 'pad_right')], padBottom: [b('10', 'pad_bottom'), b('11', 'pad_bottom')],+ seed: [b('32', 'seed')], steps: [b('32', 'steps')],+ },+ outputs: [{ node: '90', kind: 'image' }],+ limits: { padMultiple: 8 },+ vramGb: 20,+ license: 'Qwen Research License Agreement (Qwen-Image 2.1): NON-COMMERCIAL, research and evaluation only; outpaint LoRA by AusBoss under the same licence; AusBoss nodes MIT',+ notes:+ 'The owner\'s qwenImage21Outpaint_v12.json as the proven preview graph qwen21-expand runs it (FashDash\'s expand stage): Crop + Rotate + Pad puts the photo on a gray (#808080) canvas grown by the pads ' ++ '(feather 12, scaled to 1 MP on the 32 grid) -> outpaint-v2 LoRA at 1 -> Qwen3-VL 8B (the same text encoder, TextGenerate, the owner\'s instruction, seed fixed) describes the picture, ' ++ '"Outpaint the image: ... Scene:" leads -> TextEncodeQwenImage21 with the canvas as image 1 -> KSampler 25 steps, cfg 1, euler, simple, no noise mask (it drew a box at the seam) -> ' ++ 'SplitImageWithAlpha -> Stitch Inpaint (blend in, tone match 1) -> scaled to the full-size padded canvas, and the original photo composited back on top (second pad node, feather 48). ' ++ 'Pads are the input photo\'s pixels (multiples of 8); defaults 384/288/384/288 = a 1.5x zoom-out of a 1536x1152 photo. Grow at most about the photo\'s own size per side per run. ' ++ 'prompt = the optional "what goes there" hint (the lead-in "Also include in the prompt:" is added); it must not name the subject, which then appears again in the margin. ' ++ 'Removed: AusBoss Seed/Text/Compare/RunTimer/ShowText/WorkflowNote and its SaveImage (SaveImage). Proof [P]: the preview expand stills.',+ },+// ---- Fuobe DoP (Originals O4): LTX-2.3 camera moves, FPV and transitions with LoRAs ------------{id: 'ltx23-i2v-lora',diff --git a/scripts/comfy/validate-workflows.mjs b/scripts/comfy/validate-workflows.mjsindex 0b29d209..2db8be83 100644--- a/scripts/comfy/validate-workflows.mjs+++ b/scripts/comfy/validate-workflows.mjs@@ -106,7 +106,7 @@ function sampleValue(key, entry, uploads) {const DUMMY_LORAS = { loraHigh: 'fuobe_validate_lora_high.safetensors', loraLow: 'fuobe_validate_lora_low.safetensors', lora: 'fuobe_validate_lora.safetensors' };// Loader inputs whose combo lists the server's input folder (the same loaders build-library.mjs requires a binding for).-const UPLOAD_INPUTS = { LoadImage: 'image', LoadImageMask: 'image', LoadVideo: 'file', VHS_LoadVideo: 'video', LoadAudio: 'audio', VHS_LoadAudioUpload: 'audio' };+const UPLOAD_INPUTS = { LoadImage: 'image', LoadImageMask: 'image', LoadVideo: 'file', VHS_LoadVideo: 'video', LoadAudio: 'audio', VHS_LoadAudioUpload: 'audio', AUSBOSS_NODES_ImageCropRotatePad: 'image' };function ensureDummy(folder, file, created) {const p = path.join(MODELS_DIR, folder, file);diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.tsindex 7ba5053a..bb090b45 100644--- a/src/lib/catalog/models.ts+++ b/src/lib/catalog/models.ts@@ -56,6 +56,36 @@ type OpenSpec = Omit<ModelDef, "engine" | "badges"> & { badges?: ModelDef["badgeconst o = (m: OpenSpec): ModelDef => ({ ...m, engine: "open", badges: ["open", ...(m.badges ?? [])] });const open: ModelDef[] = [+ // ---- Qwen-Image 2.1 (B-Q)+ o({+ id: "oss-qwen-image-21",+ name: "Qwen-Image 2.1",+ vendor: "Alibaba Qwen",+ family: "qwen-image",+ kind: "image",+ tagline: "Native 2K images with clean lettering; edits with up to 4 references, inpaint and expand · 20 GB GPU · non-commercial weights",+ badges: ["new", "top"],+ routes: [+ comfy("t2i", "qwen-image-21-t2i"),+ comfy("edit", "qwen-image-21-edit", "25 steps, up to 4 references"),+ comfy("inpaint", "qwen-image-21-inpaint", "crops around the mask, 25 steps, pasted back"),+ comfy("outpaint", "qwen-image-21-outpaint", "outpaint-v2 LoRA; Qwen3-VL describes the scene"),+ ],+ options: { aspectRatios: IMG_AR, resolutions: ["1K", "1.5K", "2K"], maxImages: 4, seed: true },+ defaults: { aspectRatio: "1:1", resolution: "1K" },+ }),+ o({+ id: "oss-qwen-image-21-turbo",+ name: "Qwen-Image 2.1 Turbo",+ vendor: "Alibaba Qwen",+ family: "qwen-image",+ kind: "image",+ tagline: "8-step edits with up to 4 references, close to the full model except on big camera turns · 20 GB GPU · non-commercial weights",+ badges: ["new", "top", "fast"],+ routes: [comfy("edit", "qwen-image-21-turbo-edit", "8 steps, up to 4 references")],+ options: { maxImages: 4, seed: true },+ }),+// ---------------- Imageo({id: "oss-z-image-turbo",diff --git a/src/lib/comfy.ts b/src/lib/comfy.tsindex 998d69d4..0f98dd24 100644--- a/src/lib/comfy.ts+++ b/src/lib/comfy.ts@@ -641,12 +641,13 @@ export function dropLoadedSound(wf: ComfyWorkflow, loaders: string[], keep: stri/*** An optional upload with no file (a side of a multi-view 3D model nobody photographed): the loader goes, with- * every node downstream of it, up to the inputs of `into` nodes (Pixal3DMultiViewConditioning's "left"), which- * are dropped. Null when its branch doesn't end in such an input, or reaches an output node in `keep` (then the- * upload can't simply be left out).+ * every node downstream of it, up to the inputs of `into` nodes (Pixal3DMultiViewConditioning's "left"; one class+ * or a set of them), which are dropped. Null when its branch doesn't end in such an input, or reaches an output node+ * in `keep` (then the upload can't simply be left out).*/-export function dropBranch(wf: ComfyWorkflow, loaderId: string, into: string, keep: string[] = []): ComfyWorkflow | null {+export function dropBranch(wf: ComfyWorkflow, loaderId: string, into: string | ReadonlySet<string>, keep: string[] = []): ComfyWorkflow | null {if (!wf[loaderId]) return null;+ const isInto = (cls: string) => (typeof into === "string" ? cls === into : into.has(cls));const gone = new Set([loaderId]);const cut: { id: string; input: string }[] = [];for (const queue = [loaderId]; queue.length; ) {@@ -654,7 +655,7 @@ export function dropBranch(wf: ComfyWorkflow, loaderId: string, into: string, kefor (const [cid, n] of Object.entries(wf)) {for (const [input, v] of Object.entries(n.inputs)) {if (!isLinkValue(v) || v[0] !== id) continue;- if (n.class_type === into) cut.push({ id: cid, input });+ if (isInto(n.class_type)) cut.push({ id: cid, input });else if (keep.includes(cid)) return null;else if (!gone.has(cid)) {gone.add(cid);diff --git a/src/lib/licences.ts b/src/lib/licences.tsindex 345468a9..46e26bcc 100644--- a/src/lib/licences.ts+++ b/src/lib/licences.ts@@ -259,6 +259,7 @@ const KNOWN: { re: RegExp; name: string; class: LicenceClass; url?: string }[] ={ re: /inswapper/, name: "InsightFace inswapper (research only)", class: "research", url: "https://github.com/deepinsight/insightface" },{ re: /CC-BY-NC-SA-4\.0/, name: "CC BY-NC-SA 4.0", class: "non-commercial", url: SPDX("CC-BY-NC-SA-4.0") },{ re: /CC[- ]BY[- ]NC(?:[- ]4\.0)?\b/, name: "CC BY-NC 4.0", class: "non-commercial", url: SPDX("CC-BY-NC-4.0") },+ { re: /Qwen Research License/, name: "Qwen Research License", class: "non-commercial", url: "https://huggingface.co/Qwen/Qwen-Image-2.1/blob/main/LICENSE" },{ re: /Tencent Hunyuan 3D 2\.1 Community License/, name: "Tencent Hunyuan 3D 2.1 Community License", class: "regions" },{ re: /Tencent Hunyuan Community License/, name: "Tencent Hunyuan Community License", class: "regions" },{ re: /CogVideoX License/, name: "CogVideoX License", class: "conditions" },@@ -428,6 +429,7 @@ export const NODE_PACKS: NodePack[] = [pack("ComfyUI-Whisper", "https://github.com/yuvraj108c/ComfyUI-Whisper", { name: "CC BY-NC-SA 4.0", class: "non-commercial", url: SPDX("CC-BY-NC-SA-4.0"), note: "Word-timed captions in one job; non-commercial code (the author asks to be contacted for commercial use). The Whisper weights are MIT" }),pack("ComfyUI-LatentSyncWrapper", "https://github.com/ShmuelRonen/ComfyUI-LatentSyncWrapper", NO_FILE("; the LatentSync 1.6 weights are CreativeML OpenRAIL++-M"), "isolated"),pack("ComfyUI-ThinkSound_Wrapper", "https://github.com/ShmuelRonen/ComfyUI-ThinkSound_Wrapper", NO_FILE("; the ThinkSound weights are Apache-2.0"), "isolated"),+ pack("ausboss-nodes", "https://github.com/ausboss/ComfyUI-AusBoss", { name: "MIT", class: "commercial", url: SPDX("MIT"), note: "Crop For Inpaint, Stitch Inpaint and Crop + Rotate + Pad for Qwen-Image 2.1's inpaint and expand; MIT code. The Qwen-Image 2.1 weights they run are non-commercial" }),// Genjutsu's Character swap (docs/research/openjutsu-6.md §7): Akatz Labs' packs, pinned in install-comfyui.sh.pack("h3_character_swap", "https://github.com/akatz-labs/h3-character-swap-tool/tree/0670e4fdf95adf2262caa4b81afed2a9c4ae4b7b/worker_nodes/h3_character_swap", {...GPL,diff --git a/src/server/providers/comfyui.ts b/src/server/providers/comfyui.tsindex 26407948..3a6411c2 100644--- a/src/server/providers/comfyui.ts+++ b/src/server/providers/comfyui.ts@@ -603,8 +603,8 @@ export function probeComfySync(timeoutMs = 1500): boolean {// ---------------------------------------------------------------------------// Building the prompt-/** Loader classes whose input is an uploaded file, and which input holds it. */-const MEDIA_LOADERS: Record<string, string> = { LoadImage: "image", LoadImageMask: "image", LoadVideo: "file", VHS_LoadVideo: "video", LoadAudio: "audio", VHS_LoadAudioUpload: "audio" };+/** Loader classes whose input is an uploaded file, and which input holds it (AusBoss's Crop + Rotate + Pad loads the upload itself). */+const MEDIA_LOADERS: Record<string, string> = { LoadImage: "image", LoadImageMask: "image", LoadVideo: "file", VHS_LoadVideo: "video", LoadAudio: "audio", VHS_LoadAudioUpload: "audio", AUSBOSS_NODES_ImageCropRotatePad: "image" };// What we learned about each uploaded clip / track from its header (duration, size, fps, audio), by ComfyUI file name.declare global {@@ -662,6 +662,13 @@ const SLOT_RULES: Record<string, { reuse?: boolean; required?: string[]; hints?:"image-to-3d-trellis2-multiview": { hints: { image: "Add a photo of the front" }, views: { sides: ["front", "left", "back", "right"], into: "Pixal3DMultiViewConditioning" } },};+/**+ * Encoders that take their extra references as optional inputs (Qwen-Image 2.1's and FIBO 2's image list, Krea 2 Edit's+ * person): a reference left out goes with the nodes only it feeds, and the encoder runs on the ones it was given.+ * Slots drop from the last, so an encoder's numbered inputs never have a gap.+ */+const OPTIONAL_REFERENCE_INPUTS: ReadonlySet<string> = new Set(["TextEncodeQwenImage21", "TextEncodeFibo2", "Krea2EditModelPatch", "Krea2EditGroundedEncode"]);+/** Uploads that are sides of one object (image = the first side, image2 the second…), and the node they all go into. */interface ViewSlots {sides: string[];@@ -1220,8 +1227,9 @@ export async function prepareWorkflow(endpointTemplate: string, input: GenInput,values.duration = Math.round((clipLength ?? (Math.max(...tracks) || 600)) * 100) / 100 + 0.5; // the mux trims it to the picture}- // Reference images the user left out: dropped from a FLUX.2 reference chain, else the previous image- // again where that's harmless (style boards, multi-reference edits), else a clear "add …" message.+ // Reference images the user left out: dropped from a FLUX.2 reference chain or from an encoder that takes them as+ // optional inputs, else the previous image again where that's harmless (style boards, multi-reference edits), else a+ // clear "add …" message.let graph = workflow;const left: string[] = [...studioLeft];// A side nobody photographed is left out (its cut-out and crop with it); the front is needed.@@ -1240,7 +1248,8 @@ export async function prepareWorkflow(endpointTemplate: string, input: GenInput,for (const [k, prev] of [["image2", "image"], ["image3", "image2"], ["image4", "image3"]] as const) {if (rules.views || !b[k] || values[k] !== undefined || rules.required?.includes(k) || left.includes(k)) continue;if (values[prev] === undefined && !left.includes(prev)) continue;- const bypassed = b[k]!.length === 1 ? bypassReference(graph, b[k]![0].node) : null;+ const loader = b[k]!.length === 1 ? b[k]![0].node : undefined;+ const bypassed = loader ? (bypassReference(graph, loader) ?? dropBranch(graph, loader, OPTIONAL_REFERENCE_INPUTS, manifest.outputs.map((o) => o.node))) : null;if (bypassed) {graph = bypassed;left.push(k);diff --git a/tests/open-qwen-image-21.test.ts b/tests/open-qwen-image-21.test.tsnew file mode 100644index 00000000..65c0dfdb--- /dev/null+++ b/tests/open-qwen-image-21.test.ts@@ -0,0 +1,251 @@+import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { afterAll, describe, expect, it } from "vitest";+import type { GenInput, Operation } from "@/lib/catalog/types";+import { dropBranch, type ComfyWorkflow, type ManifestWorkflow } from "@/lib/comfy";++// Qwen-Image 2.1 and Qwen-Image 2.1 Turbo on the open engine (the owner's SOTA image families, 2026-10-31): text to+// image, edits with up to four references, inpaint and expand from the owner's workflows and the proven preview graphs.+const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-qwen21-"));+process.env.FUOBE_DATA_DIR = tmp;+process.env.COMFYUI_URL = "http://comfy.test:8188";+const { prepareWorkflow, getWorkflow } = await import("@/server/providers/comfyui");+const { getModel, getPreset } = await import("@/lib/catalog");+const { planGeneration } = await import("@/lib/catalog/plan");+const { licenceInfo, NODE_PACKS, workflowLicence } = await import("@/lib/licences");+const { KNOWN_MODELS, PACK_CLASSES } = await import("../scripts/comfy/library.spec.mjs");+afterAll(() => fs.rmSync(tmp, { recursive: true, force: true }));++const LIBRARY = path.join(process.cwd(), "workflows/comfyui");+const read = (f: string) => JSON.parse(fs.readFileSync(path.join(LIBRARY, f), "utf8"));+const WORKFLOWS = ["qwen-image-21-t2i", "qwen-image-21-edit", "qwen-image-21-turbo-edit", "qwen-image-21-inpaint", "qwen-image-21-outpaint"];++async function prepare(id: string, input: GenInput, op: Operation) {+ const uploads: string[] = [];+ const res = await prepareWorkflow(id, { seed: 7, ...input }, {+ generationId: "g",+ op,+ upload: async (_d, _t, name) => {+ uploads.push(name);+ return `up_${name}`;+ },+ media: () => undefined,+ serverRam: async () => undefined,+ });+ return { ...res, uploads };+}+const at = (wf: ComfyWorkflow, m: ManifestWorkflow, key: string) => (m.bindings[key] ?? []).map((t) => wf[t.node].inputs[t.input]);+const ofClass = (wf: ComfyWorkflow, cls: string) => Object.entries(wf).filter(([, n]) => n.class_type === cls);+/** The node an output node saves, followed back through its first image link. */+const savedFrom = (wf: ComfyWorkflow, m: ManifestWorkflow) => {+ const link = wf[m.outputs[0].node].inputs.images as [string, number];+ return wf[link[0]].class_type;+};+const plan = (r: Record<string, unknown>) => planGeneration({ feature: "image", ...r } as Parameters<typeof planGeneration>[0], getModel, getPreset);++describe("Qwen-Image 2.1 in the catalog", () => {+ it("routes every operation of both models to its workflow in the library", () => {+ const manifest = read("manifest.json") as { workflows: ManifestWorkflow[] };+ const byId = new Map(manifest.workflows.map((w) => [w.id, w]));+ const want: Record<string, [Operation, string][]> = {+ "oss-qwen-image-21": [+ ["t2i", "qwen-image-21-t2i"],+ ["edit", "qwen-image-21-edit"],+ ["inpaint", "qwen-image-21-inpaint"],+ ["outpaint", "qwen-image-21-outpaint"],+ ],+ "oss-qwen-image-21-turbo": [["edit", "qwen-image-21-turbo-edit"]],+ };+ for (const [id, routes] of Object.entries(want)) {+ const m = getModel(id)!;+ expect(m.engine, id).toBe("open");+ expect(m.kind).toBe("image");+ expect(m.badges).toEqual(expect.arrayContaining(["open", "new", "top"]));+ expect(m.routes.map((r) => [r.op, r.endpoint])).toEqual(routes);+ for (const [op, wid] of routes) {+ expect(byId.get(wid)?.capability, wid).toBe(op);+ expect(byId.get(wid)?.validated, `${wid} stays unvalidated until it runs on the GPU`).toBe(false);+ }+ expect(m.options.maxImages).toBe(4);+ expect(m.tagline).toMatch(/20 GB GPU · non-commercial weights$/);+ }+ expect(getModel("oss-qwen-image-21-turbo")!.badges).toContain("fast");+ // Turbo has no text to image: none of the owner's workflows runs it that way.+ expect(getModel("oss-qwen-image-21-turbo")!.routes.some((r) => r.op === "t2i")).toBe(false);+ });++ it("plans text to image, edits and inpaint from the inputs, and asks for what's missing", () => {+ expect(plan({ modelId: "oss-qwen-image-21", prompt: "a bakery sign" }).op).toBe("t2i");+ expect(plan({ modelId: "oss-qwen-image-21", prompt: "make it night", inputs: { images: ["/a.png"] } }).op).toBe("edit");+ expect(plan({ modelId: "oss-qwen-image-21", prompt: "a glass", inputs: { images: ["/a.png"], mask: "/m.png" } }).op).toBe("inpaint");+ expect(plan({ modelId: "oss-qwen-image-21", op: "outpaint", prompt: "more street", inputs: { images: ["/a.png"] } }).op).toBe("outpaint");+ expect(plan({ modelId: "oss-qwen-image-21-turbo", prompt: "relight", inputs: { images: ["/a.png", "/b.png", "/c.png", "/d.png"] } }).op).toBe("edit");+ expect(() => plan({ modelId: "oss-qwen-image-21", op: "inpaint", prompt: "a glass", inputs: { images: ["/a.png"] } })).toThrow(/paint the area/);+ expect(() => plan({ modelId: "oss-qwen-image-21", op: "outpaint", prompt: "more street" })).toThrow(/image to extend/);+ expect(() => plan({ modelId: "oss-qwen-image-21-turbo", prompt: "relight" })).toThrow(/Add an image/);+ });++ it("records the weights' licence as non-commercial and the AusBoss nodes as MIT", () => {+ const manifest = read("manifest.json") as { workflows: ManifestWorkflow[] };+ for (const id of WORKFLOWS) {+ const info = licenceInfo(workflowLicence(manifest.workflows.find((w) => w.id === id)!));+ expect(info, id).toMatchObject({ name: "Qwen Research License", class: "non-commercial" });+ }+ expect(NODE_PACKS.find((p) => p.name === "ausboss-nodes")?.licence).toMatchObject({ name: "MIT", class: "commercial" });+ });++ it("pins every file to Hugging Face and the AusBoss pack to a commit", () => {+ const pins = read("model-pins.json") as Record<string, { revision: string; sizeBytes: number; sha256: string }>;+ const packs = read("packs.json") as Record<string, { repo: string; commit: string }>;+ const files = ["qwen_image_2.1_int8_convrot.safetensors", "qwen_image_2.1_turbo_int8_convrot.safetensors", "qwen3vl_8b_int8_convrot.safetensors", "qwen_image_2.1_vae_bf16.safetensors", "qwen-image-2.1-outpaint-v2.safetensors"];+ for (const f of files) {+ const known = (KNOWN_MODELS as Record<string, { url: string }>)[f];+ expect(known?.url, f).toMatch(/^https:\/\/huggingface\.co\//);+ expect(pins[known.url], f).toMatchObject({ revision: expect.stringMatching(/^[0-9a-f]{40}$/), sha256: expect.stringMatching(/^[0-9a-f]{64}$/) });+ }+ expect(pins[(KNOWN_MODELS as Record<string, { url: string }>)["qwen_image_2.1_int8_convrot.safetensors"].url].sizeBytes).toBe(7256783064);+ expect(packs["ausboss-nodes"]).toMatchObject({ repo: "https://github.com/ausboss/ComfyUI-AusBoss", commit: "bce780f2598f47c239cbf6503ea0984f96229391" });+ expect((PACK_CLASSES as Record<string, RegExp>)["ausboss-nodes"].test("AUSBOSS_NODES_StitchInpaint")).toBe(true);+ });+});++describe("Qwen-Image 2.1 graphs as Fuobe sends them", () => {+ it("text to image: the prompt, the size from aspect and resolution on the 32 grid, the seed, 25 steps at cfg 1", async () => {+ const { workflow: wf, manifest } = await prepare("qwen-image-21-t2i", { prompt: "a bakery sign that reads OPEN", aspectRatio: "1:1", resolution: "1K" }, "t2i");+ expect(at(wf, manifest, "prompt")).toEqual(["a bakery sign that reads OPEN"]);+ expect([at(wf, manifest, "width")[0], at(wf, manifest, "height")[0]]).toEqual([1024, 1024]);+ expect(at(wf, manifest, "seed")).toEqual([7]);+ expect(ofClass(wf, "KSampler")[0][1].inputs).toMatchObject({ steps: 25, cfg: 1, sampler_name: "euler", scheduler: "simple", denoise: 1 });+ expect(ofClass(wf, "UNETLoader")[0][1].inputs.unet_name).toBe("qwen_image_2.1_int8_convrot.safetensors");+ expect(ofClass(wf, "CLIPLoader")[0][1].inputs).toMatchObject({ clip_name: "qwen3vl_8b_int8_convrot.safetensors", type: "qwen_image" });+ expect(savedFrom(wf, manifest)).toBe("SplitImageWithAlpha");+ // 2K in 16:9 is 2720x1536 on the grid, kept within 2048 in its shape.+ const wide = await prepare("qwen-image-21-t2i", { prompt: "x", aspectRatio: "16:9", resolution: "2K" }, "t2i");+ expect([at(wide.workflow, wide.manifest, "width")[0], at(wide.workflow, wide.manifest, "height")[0]]).toEqual([2048, 1152]);+ const tall = await prepare("qwen-image-21-t2i", { prompt: "x", aspectRatio: "3:4", resolution: "1.5K" }, "t2i");+ const [w, h] = [Number(at(tall.workflow, tall.manifest, "width")[0]), Number(at(tall.workflow, tall.manifest, "height")[0])];+ expect([w % 32, h % 32]).toEqual([0, 0]);+ expect(w / h).toBeCloseTo(3 / 4, 1);+ });++ it.each(["qwen-image-21-edit", "qwen-image-21-turbo-edit"])("%s: four references reach one encoder as images 1-4", async (id) => {+ const { workflow: wf, manifest } = await prepare(id, { prompt: "Put the sofa from image 2 in the room of image 1. Keep the room exactly as in image 1.", images: ["a.png", "b.png", "c.png", "d.png"] }, "edit");+ expect(at(wf, manifest, "image")).toEqual(["a.png"]);+ expect([...at(wf, manifest, "image2"), ...at(wf, manifest, "image3"), ...at(wf, manifest, "image4")]).toEqual(["b.png", "c.png", "d.png"]);+ const [encId, enc] = ofClass(wf, "TextEncodeQwenImage21")[0];+ expect(enc.inputs).toMatchObject({ prompt: expect.stringMatching(/^Put the sofa/), negative_prompt: "", resolution: 0 });+ // Each image is scaled to 2048 on its long side before the encoder, in slot order.+ const slots = [1, 2, 3, 4].map((i) => enc.inputs[`images.image_${i}`] as [string, number]);+ expect(slots.map(([node]) => wf[node].class_type)).toEqual(Array(4).fill("ImageScaleToMaxDimension"));+ expect(slots.map(([node]) => wf[(wf[node].inputs.image as [string, number])[0]].inputs.image)).toEqual(["a.png", "b.png", "c.png", "d.png"]);+ expect(slots.every(([node]) => wf[node].inputs.largest_size === 2048 && wf[node].inputs.upscale_method === "lanczos")).toBe(true);+ // The sampler starts from the encoder's latent (image 1's size), on the cached model.+ const sampler = ofClass(wf, id.includes("turbo") ? "SamplerCustomAdvanced" : "KSampler")[0][1];+ expect(sampler.inputs.latent_image).toEqual([encId, 2]);+ expect(ofClass(wf, "QwenImage21Cache")).toHaveLength(1);+ expect(at(wf, manifest, "seed")).toEqual([7]);+ expect(savedFrom(wf, manifest)).toBe("SplitImageWithAlpha");+ });++ it("the Turbo edit runs the fixed 8-step schedule at cfg 1 on the turbo model", async () => {+ const { workflow: wf, manifest } = await prepare("qwen-image-21-turbo-edit", { prompt: "Relight the scene as golden hour.", images: ["a.png"] }, "edit");+ expect(ofClass(wf, "UNETLoader")[0][1].inputs.unet_name).toBe("qwen_image_2.1_turbo_int8_convrot.safetensors");+ expect(ofClass(wf, "ManualSigmas")[0][1].inputs.sigmas).toBe("1.0, 0.978453, 0.95418, 0.926626, 0.89508, 0.845148, 0.704534, 0.414568, 0");+ expect(ofClass(wf, "CFGGuider")[0][1].inputs.cfg).toBe(1);+ expect(ofClass(wf, "KSamplerSelect")[0][1].inputs.sampler_name).toBe("euler");+ expect(manifest.bindings.steps).toBeUndefined();+ // The prompt enhancer branch is not in the graph.+ expect(ofClass(wf, "TextGenerate")).toEqual([]);+ });++ it.each(["qwen-image-21-edit", "qwen-image-21-turbo-edit"])("%s: references not given are dropped, loader and scaler with them", async (id) => {+ for (const n of [1, 2, 3]) {+ const images = ["a.png", "b.png", "c.png"].slice(0, n);+ const { workflow: wf } = await prepare(id, { prompt: "Change the jacket to red.", images }, "edit");+ const enc = ofClass(wf, "TextEncodeQwenImage21")[0][1];+ const refs = Object.keys(enc.inputs).filter((k) => k.startsWith("images.")).sort();+ expect(refs, `${n} image(s)`).toEqual([1, 2, 3].slice(0, n).map((i) => `images.image_${i}`));+ expect(ofClass(wf, "LoadImage").map(([, l]) => l.inputs.image)).toEqual(images);+ expect(ofClass(wf, "ImageScaleToMaxDimension")).toHaveLength(n);+ }+ await expect(prepare(id, { prompt: "x", images: [] }, "edit")).rejects.toThrow(/Add an image/);+ });++ it("inpaint: the photo and a red-channel mask, cropped around it, repainted and stitched back", async () => {+ const { workflow: wf, manifest } = await prepare("qwen-image-21-inpaint", { prompt: "Replace the cup with a glass of orange juice.", images: ["photo.png"], mask: "mask.png" }, "inpaint");+ expect(at(wf, manifest, "image")).toEqual(["photo.png"]);+ const [maskId, mask] = ofClass(wf, "LoadImageMask")[0];+ expect(mask.inputs).toEqual({ image: "mask.png", channel: "red" });+ const [cropId, crop] = ofClass(wf, "AUSBOSS_NODES_CropForInpaint")[0];+ expect(crop.inputs).toMatchObject({ mask: [maskId, 0], context_factor: 1.6, blend_pixels: 8, output_multiple: 32, target_megapixels: 1.5, invert_mask: false });+ // The request plus one keep sentence, read with the crop as image 1.+ const [fmtId, fmt] = ofClass(wf, "StringFormat")[0];+ expect(fmt.inputs).toMatchObject({ "values.a": "Replace the cup with a glass of orange juice.", f_string: "{a} Keep everything else exactly the same." });+ expect(ofClass(wf, "TextEncodeQwenImage21")[0][1].inputs).toMatchObject({ prompt: [fmtId, 0], "images.image_1": [cropId, 0], resolution: 0 });+ // Only the grown mask may change, from the crop's own latent.+ const noise = ofClass(wf, "SetLatentNoiseMask")[0][1];+ expect(wf[(noise.inputs.mask as [string, number])[0]]).toMatchObject({ class_type: "GrowMask", inputs: { expand: 8 } });+ expect(ofClass(wf, "KSampler")[0][1].inputs).toMatchObject({ seed: 7, steps: 25, cfg: 1, sampler_name: "euler", scheduler: "simple" });+ // Alpha dropped before the crop is stitched back into the full picture.+ const stitch = wf[(wf[manifest.outputs[0].node].inputs.images as [string, number])[0]];+ expect(stitch.class_type).toBe("AUSBOSS_NODES_StitchInpaint");+ expect(wf[(stitch.inputs.inpainted as [string, number])[0]].class_type).toBe("SplitImageWithAlpha");+ expect(stitch.inputs.stitcher).toEqual([cropId, 2]);+ await expect(prepare("qwen-image-21-inpaint", { prompt: "x", images: ["photo.png"] }, "inpaint")).rejects.toThrow(/Paint the area/);+ });++ it("expand: the photo and the pads go to both pad nodes, the hint after the lead-in, the original back on top", async () => {+ const pads = { padLeft: 256, padTop: 128, padRight: 512, padBottom: 0 };+ const { workflow: wf, manifest } = await prepare("qwen-image-21-outpaint", { prompt: "parks and swimming pools", images: ["photo.png"], extra: pads }, "outpaint");+ const padNodes = ofClass(wf, "AUSBOSS_NODES_ImageCropRotatePad").map(([, n]) => n.inputs);+ expect(padNodes).toHaveLength(2);+ for (const p of padNodes) expect(p).toMatchObject({ image: "photo.png", pad_left: 256, pad_top: 128, pad_right: 512, pad_bottom: 0, fill_color: "#808080" });+ expect(padNodes.map((p) => p.feather).sort()).toEqual([12, 48]);+ expect(ofClass(wf, "RegexReplace")[0][1].inputs.string).toBe("parks and swimming pools");+ expect(ofClass(wf, "LoraLoaderModelOnly")[0][1].inputs).toMatchObject({ lora_name: "qwen-image-2.1-outpaint-v2.safetensors", strength_model: 1 });+ expect(ofClass(wf, "KSampler")[0][1].inputs).toMatchObject({ seed: 7, steps: 25, cfg: 1 });+ // No noise mask: the whole canvas is sampled, then the stitch blends the new area in.+ expect(ofClass(wf, "SetLatentNoiseMask")).toEqual([]);+ expect(ofClass(wf, "AUSBOSS_NODES_StitchInpaint")[0][1].inputs).toMatchObject({ seam: "blend in", color_match: 1, inpainted: [ofClass(wf, "SplitImageWithAlpha")[0][0], 0] });+ expect(savedFrom(wf, manifest)).toBe("ImageCompositeMasked");+ // Apps run the graph's own pads: a 1.5x zoom-out of a 1536x1152 photo.+ const app = await prepare("qwen-image-21-outpaint", { prompt: "", images: ["photo.png"] }, "outpaint");+ for (const p of ofClass(app.workflow, "AUSBOSS_NODES_ImageCropRotatePad")) expect(p[1].inputs).toMatchObject({ pad_left: 384, pad_top: 288, pad_right: 384, pad_bottom: 288 });+ expect(app.manifest.defaults).toMatchObject({ padLeft: 384, padTop: 288, padRight: 384, padBottom: 288 });+ await expect(prepare("qwen-image-21-outpaint", { prompt: "x", images: [] }, "outpaint")).rejects.toThrow(/Add an image/);+ });++ it("saves every graph under the run's prefix, and leaves nothing that saves elsewhere", async () => {+ for (const id of WORKFLOWS) {+ const { workflow, manifest } = getWorkflow(id);+ expect(manifest.outputs.map((o) => workflow[o.node].class_type), id).toEqual(["SaveImage"]);+ expect(Object.values(workflow).filter((n) => /^(Save|Preview)/.test(n.class_type) || n.class_type.startsWith("AUSBOSS_NODES_Save")), id).toHaveLength(1);+ }+ });+});++describe("optional references (dropBranch into a set of encoders)", () => {+ const graph = (): ComfyWorkflow => ({+ 1: { class_type: "LoadImage", inputs: { image: "a.png" } },+ 2: { class_type: "LoadImage", inputs: { image: "b.png" } },+ 3: { class_type: "ImageScaleToMaxDimension", inputs: { image: ["2", 0], upscale_method: "lanczos", largest_size: 2048 } },+ 4: { class_type: "TextEncodeQwenImage21", inputs: { prompt: "", "images.image_1": ["1", 0], "images.image_2": ["3", 0] } },+ 5: { class_type: "SaveImage", inputs: { images: ["4", 0] } },+ });+ const ENCODERS = new Set(["TextEncodeQwenImage21", "TextEncodeFibo2"]);++ it("takes the loader and what only it feeds out, up to the encoder's input", () => {+ const out = dropBranch(graph(), "2", ENCODERS, ["5"])!;+ expect(Object.keys(out).sort()).toEqual(["1", "4", "5"]);+ expect(out[4].inputs).toEqual({ prompt: "", "images.image_1": ["1", 0] });+ });++ it("still takes a single class name, and refuses a branch that reaches an output", () => {+ expect(dropBranch(graph(), "2", "TextEncodeQwenImage21", ["5"])).not.toBeNull();+ expect(dropBranch(graph(), "2", new Set(["Krea2EditModelPatch"]), ["5"])).toBeNull();+ const direct = graph();+ direct[6] = { class_type: "SaveImage", inputs: { images: ["2", 0] } };+ expect(dropBranch(direct, "2", ENCODERS, ["5", "6"])).toBeNull();+ });+});diff --git a/workflows/comfyui/model-pins.json b/workflows/comfyui/model-pins.jsonindex 8639fe51..1281ca41 100644--- a/workflows/comfyui/model-pins.json+++ b/workflows/comfyui/model-pins.json@@ -164,6 +164,26 @@"sizeBytes": 948461364,"sha256": "714e5ebf094a610e12a8e3b5175c18a62f37f6ea4218acb6073644456b73ab0e"},+ "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors": {+ "revision": "aacf31a6d48e707f352ecba714cee0680da3479b",+ "sizeBytes": 7256783064,+ "sha256": "cb74113cb03faecd79611b01fd7fd642f0aa60d6f0b95086abee214d75eaa57d"+ },+ "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/diffusion_models/qwen_image_2.1_turbo_int8_convrot.safetensors": {+ "revision": "aacf31a6d48e707f352ecba714cee0680da3479b",+ "sizeBytes": 7256787829,+ "sha256": "8144a0182964aa8403ad6dbc011db837304167d235161b9aabaa8532e967314c"+ },+ "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors": {+ "revision": "aacf31a6d48e707f352ecba714cee0680da3479b",+ "sizeBytes": 9350798360,+ "sha256": "8bfd0f6e12abf2d2d697ecc888e5e90b0d6741d6708f05799f53afa560452e8f"+ },+ "https://huggingface.co/Comfy-Org/Qwen-Image-2.1/resolve/main/vae/qwen_image_2.1_vae_bf16.safetensors": {+ "revision": "aacf31a6d48e707f352ecba714cee0680da3479b",+ "sizeBytes": 675509688,+ "sha256": "bb21f7473051e1ac368515dd3f2e15cd44d7a11748ee8823e1ddca3e4876b7c9"+ },"https://huggingface.co/Comfy-Org/Qwen-Image-Edit_ComfyUI/resolve/main/split_files/diffusion_models/qwen_image_edit_2509_fp8_e4m3fn.safetensors": {"revision": "f68ace85e60b4a02a323e394253731947657b7d2","sizeBytes": 20430698424,@@ -689,6 +709,11 @@"sizeBytes": 3101572408,"sha256": "86c085c0d7853f12ce5183499934b54d08371c60f549c5a6b20615cd23989388"},+ "https://huggingface.co/ausboss/Qwen-Image-2.1-Outpaint-LoRA/resolve/main/qwen-image-2.1-outpaint-v2.safetensors": {+ "revision": "dca5bdc7eb328f6021f330140f64b00a820ae5cd",+ "sizeBytes": 159436576,+ "sha256": "3611a5ccae5f790405eeacf1dfb2c89285c1e4f2987b9abc88cd0161a60eca28"+ },"https://huggingface.co/black-forest-labs/FLUX.2-klein-4b-fp8/resolve/main/flux-2-klein-4b-fp8.safetensors": {"revision": "5b4408e59397a4a37ccb46afe426d8ed86379441","sizeBytes": 4070624520,diff --git a/workflows/comfyui/packs.json b/workflows/comfyui/packs.jsonindex dd3cd662..07e8004f 100644--- a/workflows/comfyui/packs.json+++ b/workflows/comfyui/packs.json@@ -152,6 +152,15 @@"subdir": null,"folders": []},+ "ausboss-nodes": {+ "repo": "https://github.com/ausboss/ComfyUI-AusBoss",+ "commit": "bce780f2598f47c239cbf6503ea0984f96229391",+ "registry": { "id": "ausboss-nodes", "version": "" },+ "requirementsTxt": false,+ "isolated": false,+ "subdir": null,+ "folders": []+ },"h3-relay": {"repo": "https://github.com/akatz-ai/h3-relay","commit": "e2a7665b6eb8ea37a88c0de2c9c6b69a8f7c9220",