42 Commits
Author SHA1 Message Date
Budi Hartono 1c2fa94b50 Update README.md
Update screenshot in README.md
2026-08-14 19:52:45 +07:00
Budi HartonoandClaude Sonnet 5 17f6fba87b Fix Flux.2 latent shape bug, rebuild node internals, add fast-test presets
Root-cause fix for the reported slowdown/wrong-resolution issue: Flux.2 uses
128 channels at 16x spatial downsample (comfy_extras/nodes_flux.py's
EmptyFlux2LatentImage), not 16ch/8x like Flux.1/Krea/Qwen-Image. We hardcoded
//8 for every model, so Flux.2 latents came out 2x too large per axis (4x the
pixels) — explains both the wrong output resolution and the multi-x s/it gap
versus the native node. Replaced the flat channel map with a per-model
(channels, stride) spec, validated against every model in presets.py.

By Axis previously had no model awareness at all — always assumed 4ch/8-stride
regardless of target model, silently wrong for every 16/128-channel model.
Gave it a model input (now last: primary_dim, reference, aspect_ratio,
batch_size, model), wired to the same spec table.

Both nodes now derive their model list/default from presets.py's own order
at module level instead of duplicating it — whichever model is listed first
in presets.py becomes the default everywhere, so a future architecture
doesn't need code changes elsewhere to become the default.

Also: rebuilt nodes.py/__init__.py/web extension from scratch (same node
IDs, same behavior — verified via smoke test) as a clean base for the above;
fixed two Flux.2 presets (1080 -> 1088) that weren't multiples of its
16-stride; added a 512x512 preset to every model for fast local iteration;
documented the By Axis model selector in README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-14 19:45:11 +07:00
Budi HartonoandClaude Sonnet 5 c3a208424c Add 512x512 test presets for Krea and Flux.2
Both models' native square defaults are heavy (1024/2048), too slow for
quick iteration. 512x512 is stride-valid for both (8x and 16x respectively).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-14 19:38:54 +07:00
Budi HartonoandClaude Sonnet 5 20d0637de5 Reorder By Axis widget fields, share model list/default with Preset node
model now goes last (primary_dim, reference, aspect_ratio, batch_size,
model). Both nodes derive MODELS from presets.py's own order once at
module level, so whichever model is listed first there becomes the
default everywhere — no per-node edits needed when a new architecture
takes the top spot.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-14 19:34:42 +07:00
Budi HartonoandClaude Sonnet 5 8dad556fff Rebuild nodes.py from scratch; fix Flux.2's actual 128ch/16-stride latent spec
Ground-up rewrite of nodes.py/__init__.py/web extension, keeping node IDs,
model order, and presets.py unchanged for backward compatibility.

Found the real bug while rebuilding: Flux.2 uses 128 channels at 16x spatial
downsample (comfy_extras/nodes_flux.py EmptyFlux2LatentImage), not 16ch/8x
like Flux.1/Krea/Qwen-Image. We hardcoded //8 everywhere, producing a latent
2x too large per axis for Flux.2 (4x the pixels) — explains both the wrong
output resolution and the outsized s/it gap vs the native node.

By Axis node previously had no model awareness at all, always assuming
4ch/8-stride (SD1.5-style) regardless of target model — silently wrong for
every 16/128-channel model. Added a model input so it uses the correct
per-model latent spec too. Also fixed two Flux.2 presets (1080 -> 1088) that
weren't multiples of its 16-stride requirement.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-14 19:26:53 +07:00
Budi HartonoandClaude Sonnet 5 c434c7924f Milestone: place empty latents on ComfyUI's intermediate device (fixes CPU-vs-GPU slowdown)
Stable revert point — all known correctness/perf issues (latent channel
count per model, device placement) are fixed as of this commit. If a
future rebuild goes wrong, `git reset --hard 579e130` (or this amended SHA)
returns to a known-good working state.

CPU-resident latents forced per-step CPU<->GPU transfers during sampling,
causing several-x slower s/it than the native EmptyLatentImage node even
at matching resolution/channels.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-14 18:59:53 +07:00
Budi Hartono de9ac7d681 Update README.md
Updated the nodes image.
2026-08-14 17:51:37 +07:00
Budi Hartono f91306c96d Reorder presets by 2026 relevance, drop HiDream, align publish workflow with Comfy-Org guidance
- presets.py/nodes.py: reorder model dropdown Krea > Flux.2 > Qwen-Image >
  Flux.1 > SDXL > SD15 to match current usage; drop HiDream (faded 2026
  relevance) from presets and LATENT_CHANNELS.
- README.md: sync supported-model list with presets.py.
- publish_action.yml: apply Comfy-Org's reviewer feedback — explicit
  issues:write permission (least-privilege + publish-status reporting),
  owner-gated job (fork safety), pin publish-node-action to @v1 instead of
  the mutable @main branch.
- Bump version to 1.0.9.
2026-08-14 17:45:46 +07:00
Budi Hartono 36d1667eb0 Add model-filtered preset picker and per-model latent channel count
- EmptyLatentAspectPreset gains a "model" widget; web/aspect_ratio_filter.js
  filters the "preset" combo to that model client-side, parsed from each
  preset's label so presets.py stays the single source of truth.
- Fix latent channel count: SD1.5/SDXL use 4-channel latents, but
  Flux/HiDream/Krea/Qwen-Image use 16-channel latents (same family as
  ComfyUI's EmptySD3LatentImage) — was previously hardcoded to 4 for all
  models, breaking/corrupting generations on the newer models.
- Drop Ideogram and ERNIE from presets.py: both are hosted API models with
  no local LATENT/diffusion pipeline in ComfyUI, so listing them implied
  false compatibility.
2026-08-14 17:29:40 +07:00
Budi Hartono 3b3e714a23 Dedupe preset/ratio lookups in nodes.py, refresh README model list, bump to 1.0.8
Build PRESET_MAP/RATIO_MAP once at class level instead of rebuilding on
every INPUT_TYPES/generate call. README now lists the actual supported
model families (Flux.1/2, Krea, Qwen-Image, Ideogram 4.0, ERNIE) in place
of the stale Chroma/Flux mention.
2026-08-14 16:57:19 +07:00
Budi Hartono 6439120d1d Bump version to 1.0.7 to trigger registry publish 2026-08-14 16:46:53 +07:00
Budi Hartono 0c72f6a83e Update publish workflow to latest Comfy-Org template
Bump checkout to v7, track publish-node-action@main, drop stale
permissions/owner-gate no longer in the upstream template.
2026-08-14 16:45:43 +07:00
Budi Hartono 1168200da1 Bump actions/checkout to v5 to drop Node 20 deprecation warning 2026-08-14 16:43:50 +07:00
Budi Hartono a05758f89b Fix package name to match already-registered Comfy Registry node ID
Registry publish failed: repo was already registered under node ID
comfyui-aspect-ratio-presets, but pyproject.toml name field was
aspect-ratio-presets, causing a duplicate-node conflict.
2026-08-14 16:41:09 +07:00
Budi Hartono 1fb755ca09 Merge pull request #1 from ComfyNodePRs/update-publish-yaml
Update Github Action for Publishing to Comfy Registry
2026-08-14 16:38:28 +07:00
Budi Hartono 810244f020 Refresh presets for 2026 models, rename display name, add .comfyignore
Replace outdated preset list with current-gen model resolutions (Flux.1/2,
Krea, Qwen-Image, Ideogram 4.0, Ernie) grouped logically by family and
aspect ratio. Update registry DisplayName to "ComfyUI Aspect Ratio Presets".
Add .comfyignore per Comfy Registry publishing docs and gitignore
Claude/Serena tooling state.
2026-08-14 16:36:53 +07:00
Budi Hartono 94aed468e5 Update nodes.py
Set the WIDTH and HEIGHT labels to lowercase.
2025-08-26 13:14:31 +07:00
Budi Hartono c1b7156faa Update README.md 2025-06-12 17:55:46 +07:00
Budi Hartono 8be6cf13d5 Update README.md 2025-06-12 17:55:04 +07:00
Budi Hartono b96fa7df68 Update README.md
Updated the screenshot.
2025-06-12 17:35:09 +07:00
Budi Hartono a3d2ecd603 Improve node labels.
The node class mappings were renamed to concise labels (“CAS Empty Latent Aspect Ratio Preset” and “CAS Empty Latent Aspect Ratio Axis”) to make them appear shorter and clearer in the ComfyUI interface
2025-06-12 17:28:20 +07:00
Budi Hartono fd659d5e8a Added width/height outputs; shortened node names.
The code was updated to include the generated width and height as additional outputs alongside the latent tensor for both the aspect ratio preset and axis-based latent nodes, while preserving the original return format ({"samples": latent}) for compatibility. Additionally, the node class mappings were renamed to concise labels (“CAS Empty Latent Aspect Ratio Preset” and “CAS Empty Latent Aspect Ratio Axis”) to make them appear shorter and clearer in the ComfyUI interface. These improvements provide users with immediate access to the selected or calculated dimensions in their workflows and make the nodes easier to identify in the node menu.
2025-06-12 17:26:19 +07:00
Budi Hartono 1f38f59cd2 Delete node.zip 2025-06-08 10:29:58 +07:00
Budi Hartono c049a7fe16 Update .gitignore
Add node.zip
2025-06-08 10:28:38 +07:00
Budi Hartono 5a60f784e2 Update README.md 2025-06-08 00:57:52 +07:00
Budi Hartono 41e733b3ed Update README.md
Add a screenshot of the nodes.
2025-06-08 00:50:59 +07:00
Budi Hartono 446fd43775 Update nodes.py
Change empty_latent output node labels to LATENT
2025-06-08 00:47:29 +07:00
Budi Hartono bc33596901 Update pyproject.toml
Bug fix
2025-06-08 00:39:15 +07:00
Budi Hartono cf5ed3a4d1 Update nodes.py
Fix minor bug.
2025-06-08 00:38:44 +07:00
Budi Hartono 3d7c4912d4 Update README.md 2025-06-08 00:11:56 +07:00
Budi Hartono 9307dc645e Merge branch 'main' of https://github.com/budihartono/comfyui-aspect-ratio-presets 2025-06-08 00:05:03 +07:00
Budi Hartono c9327ca3ae Update README.md
Incorporating changes.
2025-06-08 00:04:33 +07:00
Budi Hartono fd346e15f0 Create publish_action.yml 2025-06-07 23:53:15 +07:00
Budi Hartono a932b55d56 Publishing to Comfy Registry
Publishing to Comfy Registry
2025-06-07 23:49:43 +07:00
Budi Hartono a3cf0c6d0d Update nodes.py
Minor change, insert another '-' in the preset dropdown.
2025-06-07 23:24:32 +07:00
Budi Hartono b20737da03 Renamed Nodes
Renamed the nodes with CAS, Custom ASpect Ratio

Changed the preset string format to:

912x512 16:9 Landscape - SD15
512x768 2:3 Portrait - SD15
1024x1024 1:1 Square - SDXL
…
2025-06-07 23:18:04 +07:00
Budi Hartono 8103bf98ad Works for the first time 2025-06-07 22:19:10 +07:00
Budi Hartono eef1907b11 Change Widget to Dropdowns 2025-06-07 21:40:39 +07:00
Budi Hartono b728681a37 Fix: Loaded Successfully in ComfyUI 2025-06-07 21:17:44 +07:00
Budi Hartono a91f8e1adb Create __init__.py 2025-06-07 20:34:37 +07:00
Budi Hartono 44d99210ae Updated GitHub project information
Updated GitHub project information
2025-06-07 19:56:17 +07:00
Budi Hartono 222960a4a7 Initial commit 2025-06-07 19:54:50 +07:00