AIO Image Generate
Helto all-in-one ComfyUI image generation nodes with managed privacy.
AIO Image Generate
A classic ComfyUI custom node pack for an extensible all-in-one image generation node. The visible node is a simple facade, while model-family behavior lives in profiles, adapters, loader backends, validation services, and shared progress utilities.
Installation
Clone or copy this folder into ComfyUI/custom_nodes, install its Python dependencies with the same interpreter that runs ComfyUI, then restart ComfyUI:
python -m pip install -r ComfyUI/custom_nodes/comfyui-all-on-one-image-generation-node/requirements.txt
The required packages are helto-privacy and cryptography. ComfyUI Manager may install requirements.txt automatically; the command above is the explicit fallback.
Nodes
AIO Image GenerateZ-Image Turbo SettingsFLUX.2 Klein 9B SettingsIdeogram 4 Prompt BuilderIdeogram 4 SettingsKrea 2 SettingsAIO InpaintAIO LoRA ConfigurationAIO Load Pipeline Models
All nodes appear under AIO/Image.
Supported Model Families
z_image_turbo: text-to-image generation, defaults to 8 steps and CFG 1.0.flux2_klein_9b: text-to-image, reference-image, and AIO Inpaint generation. Distilled defaults to 4 steps; base defaults to 50 steps. Reference mode is inferred from how many reference images are connected. WhenComfyUI-Inpaint-CropAndStitchis installed, Flux inpaint samples a cropped working area and stitches the decoded result back to the original canvas size.ideogram4: local open-weight Ideogram 4 text-to-image generation, defaults to the official 20-step Ideogram scheduler preset with dual-model CFG 7.0.krea2: local Krea 2 text-to-image, reference-image img2img, and AIO Inpaint generation. It defaults to the provided workflow's 8-steper_sde/simplesampler path, CFG 1.0, and 1344x2048 canvas.
AIO Image Generate defaults use_zero_negative_conditioning to enabled. When enabled, every model uses zeroed positive conditioning for sampler negative conditioning and non-empty negative prompts on models that previously ignored them are still reported in run_info.warnings. Disable it to encode and use the negative_prompt for every model, regardless of CFG value.
Supported Formats
safetensors: native ComfyUI model-path resolution throughfolder_paths.gguf: optional only. GGUF requires a compatible external backend such as ComfyUI-GGUF. The node detects GGUF per selected file extension and does not silently fall back to safetensors.- GGUF text encoders are listed through the installed backend's
clip_gguffolder key when available. This matches ComfyUI-GGUF's*CLIPLoader (GGUF)pattern, which can list regular and GGUF text encoder files.
If any selected model file ends in .gguf without a compatible backend, the node raises:
A GGUF model file was selected, but no compatible GGUF backend was detected.
Model Folder Expectations
The main node resolves filenames lazily at execution time:
- diffusion model:
models/diffusion_models,models/unet,models/checkpoints, or backend-provided GGUF keys such asunet_gguf/model_gguf - text encoder:
models/text_encoders,models/clip, or backend-provided GGUF keyclip_gguf - VAE:
models/vae, plus backend-providedvae_ggufwhen available
Ideogram 4 expects the conditional diffusion model, unconditional diffusion model, Qwen3-VL text encoder, and FLUX.2 VAE from the Comfy-Org Ideogram 4 packaging. A typical setup is:
- conditional diffusion model:
ideogram4/ideogram4_fp8_scaled.safetensors - unconditional diffusion model:
diffusion_models/ideogram4/ideogram4_unconditional_fp8_scaled.safetensors - text encoder:
qwen3vl_8b_fp8_scaled.safetensors - VAE:
flux.2/flux2-vae.safetensors
Krea 2 expects a Krea 2 diffusion model, a Krea 2 compatible Qwen3-VL text encoder, and the Qwen Image VAE. The workflow defaults are:
- diffusion model:
krea/krea2_turbo_fp8.safetensors - text encoder:
qwen3vl_4b_fp8_scaled.safetensors - VAE:
qwen_image_vae.safetensors
The dropdown may prefix values with their category when multiple folders are searched.
Basic Usage
- Add
AIO Image Generate. - Select
model_type. - Select diffusion model, text encoder, and VAE files.
- Enter a positive prompt.
- Optionally attach the matching model-specific settings node.
- For Ideogram 4 or Krea 2, optionally connect
Ideogram 4 Prompt Builderto the matching settings node to use structured JSON prompting. - Optionally attach
AIO LoRA Configurationto apply one or more LoRAs. - For Krea 2 img2img, connect a reference to
image 1and adjustreference_denoiseinKrea 2 Settings. - Optionally attach
AIO Inpaintto edit only a masked source-image area on supported model families. - Optionally use
AIO Load Pipeline Modelsand externalMODEL/CLIPpatch nodes after the LoRA phase. - Optionally enable the second sampler pass to upscale the first generated image, VAE-encode it, and refine it with low denoise.
- Connect
IMAGEto Preview Image or Save Image.
The node is not an output node, so it is safe for API-mode workflows.
Settings Nodes
Z-Image Turbo Settings returns an AIO_MODEL_SETTINGS dict with the effective sampling-step override, precision policy, attention backend, Torch compile, and performance-apply timing. Z-Image Turbo does not expose prompt-enhancement or speed-preset controls because this pack has no runtime implementation for them.
FLUX.2 Klein 9B Settings returns an AIO_MODEL_SETTINGS dict with distilled/base variant, guidance, precision policy, memory policy, reference scaling controls, attention backend, Torch compile, and performance-apply timing. Distilled uses a 4-step default and base uses a 50-step default; an explicit main-node step count overrides either default. FLUX.2 Klein edit mode is inferred from connected reference image sockets. The settings node does not expose FLUX.1-style shift controls because ComfyUI's FLUX.2 scheduler does not consume them.
Ideogram 4 Settings returns an AIO_MODEL_SETTINGS dict with the unconditional model toggle and model path, sampling preset, dual CFG, final CFG override window, AuraFlow sampling shift, precision policy, attention backend, Torch compile, and performance-apply timing. The official presets use Ideogram 4 sigmas; Workflow Compatible uses the saved workflow's simple scheduler path. Disable run_unconditional_model for turbo LoRA workflows that should skip the separate unconditional diffusion model and run the guider with the conditional model only.
Krea 2 Settings returns an AIO_MODEL_SETTINGS dict with Krea2T enhancer controls, precision policy, attention backend, Torch compile, performance-apply timing, CUDA fp16 accumulation callbacks, a text-conditioning max_length control up to 4096, reference_denoise, and an optional prompt-builder socket. The enhancer is enabled by default with strength 1.0; strength 0.0 disables the model patch. reference_denoise defaults to 0.65: lower values preserve more of image 1, while higher values allow stronger prompt-driven changes. It is ignored when no Krea reference is active. Connect the first Ideogram 4 Prompt Builder output to use its structured prompt and resolved dimensions for normal Krea 2 generation.
Ideogram 4 Prompt Builder returns an AIO_IDEOGRAM4_PROMPT payload plus convenience prompt, preview, bboxes, width, and height outputs. Connect its first output to Ideogram 4 Settings or Krea 2 Settings. When connected, the generated JSON prompt replaces the main node's positive_prompt, and the builder's resolved dimensions replace the main node's size controls for normal Ideogram 4 and Krea 2 generation. The builder uses the same max side, aspect ratio, and multiple value calculation as AIO Image Generate; it does not expose raw width/height inputs. For Krea/Qwen-style image models, enable xy bbox order when the model expects [xmin,ymin,xmax,ymax]; the prompt string output remains available for nodes that only accept text. The optional px mode emits bbox coordinates in resolved pixels instead of the default 0-1000 grid.
The prompt builder's default JSON output is KJ/Ideogram-compatible: compact output uses the same key order, bbox normalization, palette casing, bbox order, and compact separators as Ideogram4PromptBuilderKJ.
Privacy Mode
AIO Image Generate and Ideogram 4 Prompt Builder include a privacy_mode toggle. When enabled, prompt text and prompt-builder editor state are saved to workflow JSON as AES-256-GCM envelopes under the helto.aio-image-generate.v2 schema, using the shared Helto privacy keystore at ~/.config/helto/privacy_keystore.json. The frontend also masks private text while the node is not hovered and reveals it while the pointer is inside the node.
Encrypted workflows require the shared privacy keystore to be initialized and unlocked through the Helto privacy dialog. Older AIO envelopes written under the helto.aio-image-generate schema are intentionally unsupported by this version and must be re-entered.
Privacy mode protects prompt text, prompt-builder state, private prompt-library metadata, run-info debug data, and UI execution-history payloads from being stored as plaintext. When ComfyUI has an external cache provider, private prompt-producing nodes deliberately bypass its cache. Privacy mode does not protect against clients or processes that can reach an unlocked ComfyUI server with a valid local privacy token.
All settings nodes expose attention_mode (auto, off, sage, sage3, flash, xformers, pytorch, split, sub_quad), torch_compile_mode (auto, off, on), torch_compile_backend (inductor, cudagraphs), and performance_apply_timing (after_loras, before_loras). auto attention selects the best installed compatible backend, off leaves ComfyUI defaults untouched, and after_loras applies attention/compile patches to the final LoRA-patched model.
Krea 2 additionally exposes fp16_accumulation_enabled, matching the provided workflow's torch matmul setting behavior when the runtime supports ComfyUI model callbacks. Its text-conditioning max_length defaults to 4096 and is capped at 4096.
The main node rejects mismatched settings, for example connecting FLUX settings while model_type is z_image_turbo.
LoRA Configuration
AIO LoRA Configuration returns an AIO_LORA_CONFIG dict for the main node. Its UI is modeled after rgthree's Power LoRA Loader: add ordered LoRA rows, toggle rows, toggle all from the node menu, reorder or remove rows from the row context menu, and choose single or separate model/clip strengths.
LoRAs are applied after the diffusion model and text encoder are loaded, and before prompt encoding and sampling. This matches how a normal workflow would place LoRA loaders after model loading. The backend uses ComfyUI's LoraLoader.load_lora, so LoRA files stay lazy and are not loaded at import time.
The read-only /aio-image-gen/api/loras catalog returns every LoRA registered
under ComfyUI's configured loras search paths. Browser clients on the same
host or local/private network, including a SillyTavern instance on another
port, may read this catalog. Its explicit preflight also supports Chromium's
Private Network Access checks between private and loopback addresses. Public
unrelated cross-origin sites are not granted access. The response contains
relative model names only and never exposes server filesystem paths.
Ideogram 4 applies LoRAs to the conditional diffusion model only, matching ComfyUI's LoraLoaderModelOnly workflow pattern. The Qwen3-VL text encoder and unconditional model are not LoRA-patched by the Ideogram 4 adapter. When run_unconditional_model is disabled, the unconditional model is not required, loaded, or patched.
The LoRA info button is also implemented locally. A normal backend metadata request reads the selected LoRA and any existing sidecar without a Civitai API lookup or disk write. The explicit Civitai refresh action can fetch model-version data by SHA256 hash and persist it to *.aio-lora-info.json beside the LoRA. Editable notes/strength hints are stored in that sidecar. All file access is confined to ComfyUI's configured LoRA roots.
Attribution
The LoRA configuration node and LoRA info dialog are inspired by and partially adapted from rgthree-comfy, especially its Power LoRA Loader UI and model-info dialog. rgthree-comfy is copyright Regis Gaughan, III (rgthree) and is distributed under the MIT License.
The Ideogram 4 prompt builder backend formatting and editor behavior are adapted from ComfyUI-KJNodes' Ideogram4PromptBuilderKJ, which is distributed under GPL-3.0. See THIRD_PARTY_NOTICES.md.
The Krea2T prompt-adherence enhancer is adapted from ComfyUI-Krea2T-Enhancer, which is distributed under MIT. See THIRD_PARTY_NOTICES.md.
API workflows can pass rgthree-style dynamic row payloads directly:
{
"show_strengths": "separate",
"match": "style",
"lora_1": {
"on": true,
"lora": "my_style.safetensors",
"strength": 0.8,
"strengthTwo": 0.6
}
}
API workflows can also expose an API-only stsc_lora_control input on
AIOLoraConfiguration. This does not add or reorder visible ComfyUI widgets.
The value may be a JSON object, a JSON string, or a
stsc-lora-v1: base64url-encoded JSON string:
{
"schemaVersion": "1.0",
"mode": "replace",
"loras": [
{
"name": "characters/example.safetensors",
"enabled": true,
"strength_model": 0.8,
"strength_clip": 0.65
}
]
}
replace ignores the serialized workflow rows for that execution. merge
updates matching rows in place, removes rows marked disabled from the
effective stack, and appends new rows. Runtime names use exact relative paths
or an unambiguous exact basename; fuzzy substring matches are rejected.
Malformed versions, modes, duplicate names, non-finite strengths, ambiguous
names, and stacks above 64 rows fail before LoRA application. An empty value
or an unexpanded %stsc_lora_control% placeholder preserves the original
workflow behavior.
run_info.loras records the enabled, non-zero LoRAs that were applied.
run_info.performance records the requested and resolved attention mode, Torch/Triton compile mode, compile backend, and whether performance patches were applied before or after LoRAs.
Second Sampler Pass
AIO Image Generate can run an optional second img2img pass after the normal first-pass image is decoded. When enabled, the node upscales the first-pass image, VAE-encodes the upscaled image, samples it again with the same post-LoRA model, VAE, seed, sampler, scheduler, and conditioning, then decodes the refined output as the main image.
Controls:
second_pass_enabled: enable the upscaled refinement pass.second_pass_steps: second-pass step count. The default0reuses the main resolved step count.second_pass_denoise: second-pass denoise strength, default0.15.second_pass_upscale_ratio: image scale factor, default1.5.second_pass_upscale_method: resize filter, defaultlanczos.
When the pass is enabled, image_original exposes the first-pass image before upscaling/refinement. run_info.second_pass records whether the pass ran, the second-pass step input and effective step count, the denoise/upscale settings, the first-pass size, and the final refined size.
External Model Patching
AIO Load Pipeline Models loads the same diffusion model and text encoder pair as the main node, applies an optional AIO_LORA_CONFIG, then outputs standard ComfyUI MODEL and CLIP values. Connect those outputs through any compatible external model/CLIP patch nodes, then connect the patched results to the optional model and clip inputs on AIO Image Generate.
When both model and clip are connected, the main node treats them as already post-LoRA and skips internal model/CLIP loading and LoRA application. This supports external model modifications after AIO LoRAs while keeping the one-node generation path available for simple workflows. If your patch node only modifies MODEL, route the loader's CLIP output directly into the main node's clip input.
Utility Info Outputs
AIO Image Generate keeps its main image, latent, run info, width, height, and image_original outputs directly on the node. Internal values are grouped into compact info outputs:
model_info: connect toAIO Model Infoto accessmodel,clip,positive,negative, andvae. Heavy fields such asmodelandclipare only populated when their matchingAIO Model Infooutputs are connected, or when the graph cannot prove which field a direct bundle consumer needs.pid_info: connect toAIO PID Infoto access captured PIDlatent,sigma, andstep.inpaint_info: connect toAIO Inpaint Infoto access the prepared inpaint source image, decoded pre-stitch/pre-blend sample, and working mask.
These grouped sockets replace the old direct model/conditioning/VAE, PID, and inpaint debug outputs. Existing workflows connected to those old sockets need to reconnect through the matching info node.
Known Limitations
- GGUF depends on an external compatible backend such as ComfyUI-GGUF.
- Output size is controlled globally with
size mode,max side,aspect ratio, andmultiple value, except when an Ideogram 4 Prompt Builder is connected through Ideogram 4 Settings; in that case the builder dimensions override the main node for Ideogram 4. - FLUX.2 Klein supports up to four reference images through
image 1toimage 4. - FLUX.2 Klein settings expose reference image scaling controls, defaulting to 1.0 megapixel,
area, and 1 resolution step. For Flux inpaint on 16 GB GPUs, keeping connected references at or below 1.0 megapixel is recommended. - FLUX.2 Klein supports inpaint through the dedicated
AIO Inpaintconfig node. WithComfyUI-Inpaint-CropAndStitchinstalled, the Flux path uses the shared crop/stitch controls, crops around the mask, uses ComfyUIInpaintModelConditioning, samples the working crop, and stitches the decoded result back to the original image size. NewAIO Inpaintnodes default to crop/stitch-style values: mask grow 8% of the active mask bounding box, mask feather 24px,steps=0to reuse the main resolved step count, and a 1024x1024 working crop target. Set a positivestepsvalue to run the inpaint pass with fewer or more sampler steps than the main generation. The advancedsource_latent_modecontrol can be set tofull imageto bypass crop/stitch and encode the whole source frame as the input latent; the full-frame path still obeysmax_full_frame_megapixelsandmax_full_frame_sidebefore VAE/sampling. The generation path keeps the crop/stitch node's default GPU mode for parity with the original workflow. The node'sfinal_maskoutput shows the stitcher blend mask projected back to source image size, or the source-size grown and feathered mask on the fallback/full-image path. Crop/stitch mask preview preparation uses CPU mode to avoid occupying Flux sampler VRAM for large source images. AIO Image Generateexposes optional inpaint debug values throughAIO Inpaint Infofor the prepared working image, decoded pre-stitch/pre-blend sample, and working mask so crop/stitch behavior can be inspected before final compositing.- Without the optional crop/stitch node pack, Flux falls back to full-frame masked sampling and final blend. The fallback path downsizes large full-frame inputs using
max_full_frame_megapixelsandmax_full_frame_sidefromAIO Inpaintbefore VAE/sampling, so the fallback output may be smaller than the original source. - FLUX.2 Klein latent-only inpaint output returns the sampled working latent; decoded image output is the path that restores the original canvas size.
- The legacy
maskinput is still only accepted alongsideimage 1and is not the inpaint contract. - Ideogram 4 supports text-to-image and
AIO Inpaintin this adapter. WithComfyUI-Inpaint-CropAndStitchinstalled, Ideogram inpaint uses the shared crop/stitch controls by default, samples a clean-source latent withnoise_mask, and stitches the decoded crop back to the original image size;source_latent_mode=full imageinstead encodes the whole bounded source frame and blends the decoded result directly. It does not use FluxInpaintModelConditioning. Reference images, legacy masks, and GGUF model files are not implemented for Ideogram 4. - Ideogram 4 output dimensions must be multiples of 16, between 256 and 2048 pixels per side, with aspect ratio no wider than 6:1.
- Krea 2 supports text-to-image, single-reference img2img through
image 1, andAIO Inpaint. For reference img2img, the input is resized to the resolved generation dimensions, VAE-encoded as the starting latent, and sampled withreference_denoise. Path selection is automatic: an active AIO Inpaint config takes priority and uses its inpaint latent; when Inpaint is disabled or absent,image 1becomes the Krea reference. A retained workflow connection alone does not select Inpaint. Krea accepts only the first reference image and does not support the legacymasksocket. run_info.referencereports the privacy-safe runtime path selection without including image or prompt content. For Krea reference img2img,modeiskrea2_reference_img2img,krea2_reference_activeistrue, andeffective_denoiseis the value actually selected. If active Inpaint takes priority,modeisinpaintandsuppressed_by_inpaintidentifies a still-connectedimage 1. Theworkflow_image_1_linked,prompt_image_1_linked, andruntime_image_1_receivedflags trace a reference link through serialization without exposing its data; legacyimage_1prompt aliases are reported separately.- The Krea inpaint path uses the shared crop/stitch controls by default, samples a clean-source latent with
noise_mask, and stitches or blends the decoded result back into the source image;source_latent_mode=full imageinstead encodes the whole bounded source frame and blends the decoded result directly. It does not use FluxInpaintModelConditioning. GGUF requires a compatible external backend and Krea-compatible GGUF model files. - Krea 2 output dimensions must be multiples of 16.
- Z-Image reference-image and mask paths are staged for a later adapter pass.
Adapter Implementation Notes
Local ComfyUI source was inspected before implementing the generation pipeline. Relevant references:
/home/thhel/git/ComfyUI/nodes.py: classicNODE_CLASS_MAPPINGS,folder_paths,UNETLoader,CLIPLoader,VAEEncode,VAEDecode,ImageScaleBy,common_ksampler,InpaintModelConditioning/home/thhel/git/ComfyUI/comfy/sample.py:comfy.sample.samplesignature/home/thhel/git/ComfyUI/comfy/samplers.py: samplernoise_maskand denoise-mask behavior/home/thhel/git/ComfyUI/comfy/utils.py:ProgressBar,common_upscale/home/thhel/git/ComfyUI/comfy_extras/nodes_flux.py:EmptyFlux2LatentImage, Flux guidance, Flux2 scheduler/home/thhel/git/ComfyUI/comfy_extras/nodes_ideogram4.py: Ideogram 4 scheduler and sigma helper/home/thhel/git/ComfyUI/comfy_extras/nodes_custom_sampler.py:DualModelGuider,CFGOverride,RandomNoise,KSamplerSelect,SamplerCustomAdvanced,BasicScheduler/home/thhel/git/ComfyUI/comfy_extras/nodes_model_advanced.py:ModelSamplingAuraFlow/home/thhel/git/ComfyUI/comfy_extras/nodes_zimage.py: Z-Image conditioning node patterns/home/thhel/git/ComfyUI/comfy/text_encoders/krea2.py: Krea 2 flattened text-conditioning shape/home/thhel/git/ComfyUI/comfy/model_base.py: Krea 2 extra conditioning fields and Flux/Flux2 concat inpaint conditioning/home/thhel/git/ComfyUI/comfy/supported_models.py:Flux2,Ideogram4,Krea2, andZImagemodel-family detection/home/thhel/git/ComfyUI/nodes.py:LoraLoader.load_lora,LoraLoaderModelOnly,CLIPTextEncode/home/thhel/git/ComfyUI/custom_nodes/rgthree-comfy/py/power_lora_loader.py: Power LoRA dynamic backend payload shape/home/thhel/git/ComfyUI/custom_nodes/rgthree-comfy/web/comfyui/power_lora_loader.js: Power LoRA frontend interaction model/home/thhel/git/ComfyUI/custom_nodes/rgthree-comfy/web/comfyui/dialog_info.js: rgthree LoRA info dialog behavior/home/thhel/git/ComfyUI/custom_nodes/rgthree-comfy/web/common/css/dialog_model_info.css: rgthree LoRA info dialog layout and visual styling/home/thhel/git/ComfyUI/custom_nodes/comfyui-kjnodes/nodes/ideogram4_nodes.py: Ideogram 4 structured prompt JSON shape and preview/bbox behavior/home/thhel/git/ComfyUI/custom_nodes/comfyui-kjnodes/web/js/ideogram4_prompt_builder.js: Ideogram 4 prompt builder frontend interaction model/home/thhel/git/ComfyUI/custom_nodes/ComfyUI-GGUF/nodes.py:UnetLoaderGGUF,CLIPLoaderGGUF,clip_gguf, andunet_ggufpath/list patterns/home/thhel/git/ComfyUI/custom_nodes/gguf/pig.py:clip_gguf,model_gguf, andvae_ggufpath/list patterns/home/thhel/git/ComfyUI/custom_nodes/comfyui-inpaint-cropandstitch/inpaint_cropandstitch.py: optionalInpaintCropImproved/InpaintStitchImprovedcrop-stitch node contract
The adapters compose these existing primitives lazily at execution time so importing the node pack does not load ComfyUI models, torch, or GGUF packages.
How To Add A New Model Family
- Add a profile in
services/profiles.py. - Add an adapter in
adapters/and decorate it withregister_adapter. - Optionally add a settings node that returns
AIO_MODEL_SETTINGS. - Register the settings node in root
__init__.py. - Add tests for defaults, validation, settings, and registry behavior.
Nodes V3 Migration Notes
This pack uses classic nodes for broad community compatibility. The contracts are intentionally kept clean for a future V3 wrapper: no frontend-only execution state, no hidden mutable globals, and model-family logic isolated behind adapters and services.
License
This combined node pack is distributed under the GNU General Public License version 3 only (GPL-3.0-only) because it includes an Ideogram 4 prompt-builder implementation adapted from GPL-3.0 KJNodes sources. See LICENSE for the full terms.
MIT-licensed portions adapted from rgthree-comfy and ComfyUI-Krea2T-Enhancer retain their upstream copyright and permission notices. The original AIO MIT notice is also retained. See THIRD_PARTY_NOTICES.md for all retained notices.