Extensions/Apex Artist - Image Resize
ComfyUI Extension

Apex Artist - Image Resize

Professional image resizing node with 6 advanced algorithms, intelligent aspect ratio handling, crop/pad options, and batch processing support. Perfect for AI workflows, photography, and digital art.

By ApexArtist·Created about a year ago·Updated 6 days ago· 6
ApexArtist/comfyui-apex-artist
Nodes9
On cloudLocal install
CategoryApex Artist/Image/Filters, Apex Artist/Text
Stars6
Updated6 days ago
Readme

ComfyUI Apex Artist

Image processing, prompt presets, audio selection and a video timeline editor inside ComfyUI.

Nodes

| Node | Purpose | | --- | --- | | Apex Blur | Nine blur methods, including Gaussian, motion, lens and depth blur | | Apex Sharpen | Eight sharpening methods | | Apex Layer Blend | Layer compositing with 25+ blend modes | | Apex Depth to Normal | Convert depth maps to RGB normal maps | | Apex HDRI Viewer | Aim a camera into a panorama and output front/back views | | Apex LoRA Loader | Browse configured LoRA folders with thumbnail previews | | Apex Prompt | Environment, Lighting, Style, Color and Camera Lens presets | | Apex Character Prompt | Twelve character categories with separate and combined text outputs | | Apex JSON Lookup | Read JSON values; optional strict parsing, schema checks and JSON-safe output | | Apex Audio Lyrics | Local Whisper transcription with editable lyrics and decoding controls | | Apex Optional Images | Growing optional image sockets with batch and count outputs | | Apex Audio | Load or connect audio, trim, adjust gain, preview and read metadata | | Apex Timeline Editor | Edit persistent video/audio tracks and output standard ComfyUI media | | Apex V1 Cut Window | Read actual main-track joins for B-roll audio crops and placement | | Apex Memory Cleanup | Release completed clip intermediates after saving, collect garbage and clear unused device memory |

Installation

Requires Python 3.10+, ComfyUI 0.42.1+, and the dependencies in requirements.txt. Timeline rendering also needs FFmpeg available on PATH. PyTorch, PyAV, Pillow and the native audio/video APIs come from ComfyUI.

Memory cleanup (development)

Connect a save/capture result to Apex Memory Cleanup, then its value to End Loop. In an uncached native loop it releases completed loop outputs, including expanded internal nodes, after their known consumers finish. Shared nodes outside the loop and values needed by pending readers remain. Outside a loop it targets completed upstream intermediates and preserves model outputs. Explicit iteration caching is respected.

Cache release, garbage collection and unused device-cache cleanup default on; model unloading defaults off. The report gives removed entry count and free device memory before/after; on CPU this is system memory. A memory change is not a measurement of bytes owned by removed entries. Use a file-backed VIDEO or small completion value as the trigger: an IMAGE/LATENT passed through remains live. It does not clear another extension's private caches, promise a fixed memory saving, or make one oversized render fit. Device cleanup uses ComfyUI's backend functions. The cache adapter is tested against the supported native cache classes; unsupported caches are reported without eviction. No extra dependency. Restart and refresh are required to register new nodes. This local addition is not a release.

Strict JSON handoffs

Apex JSON Lookup keeps its original text and dotted key inputs and its existing lenient defaults. Enable strict to stop on malformed JSON or a missing path instead of returning empty/partial text. A complete Markdown JSON fence is accepted. Strict mode rejects duplicate object keys and non-finite numbers.

The optional schema validates the extracted value with JSON Schema 2020-12 and enables strict parsing. Local schema references work; external schema retrieval is disabled. Use as_json to output valid JSON scalars as well as objects/arrays, preserving quoted strings, backslashes, Unicode, booleans and null when assembling a subsequent JSON object. In strict/JSON-output mode, an empty key or $ selects the whole document. Existing two-input workflows keep their previous empty-key and text-fallback behavior.

Clone this repository into ComfyUI's custom_nodes folder:

git clone https://github.com/ApexArtist/comfyui-apex-artist.git

Using the Python environment that runs ComfyUI, install requirements.txt. Restart ComfyUI and hard-refresh the browser. Find the nodes under Apex Artist in the Add Node menu.

Prompt presets

Apex Prompt combines input text → environment → lighting → style → color → camera lens. It returns the combined prompt and five category texts. Each selector accepts Disabled, Random or a named preset. Random choices are deterministic for the seed.

Save Preset… saves text for one category. Manage Presets… supports search, copying factory presets, editing user presets and import/export. Factory entries stay read-only; user entries appear as User: Name. Saving user entries does not change the seeded factory Random pool. Share a library export with workflows that reference its names.

Apex Character Prompt has twelve selectors: gender, age, ethnicity, face, eye color, skin tone, hair, headwear, top, bottom, shoes and hand accessory. Its thirteen outputs contain the combined prompt and individual category texts. Optional input text leads the combined output. Manage Character Presets… edits the character library, with import/export and Use controls. Missing named presets raise an error instead of disappearing silently.

Both libraries save atomically beneath ComfyUI's configured user directory:

apex_artist/prompt_presets.json
apex_artist/character_presets.json

These libraries are shared by clients of the same server. Revision checks reject stale saves and keep the editor draft. Character API reads return an ETag; writes require it in If-Match. One writing ComfyUI process is supported. Export custom libraries before reinstalling or moving installations. Existing bundled character edits seed the library until its first user save; later edits use the user copy.

Audio

Load/upload a file or connect standard AUDIO; a connection takes priority. Drag the waveform handles or enter start and duration in seconds. Duration 0 selects the remaining source. Gain ranges from 0–200%, with 100% unchanged. Preview plays the selection. Outputs are AUDIO, selected duration, sample rate, channels and sample count.

Source files remain unchanged. No resampling or normalization is applied. Disable Preview to skip waveform generation and connected-input preview encoding; connected previews become available after execution.

Audio lyrics and optional references

Apex Audio Lyrics transcribes standard AUDIO locally. It exposes language, device, corrected lyrics, local Whisper model, beam size, previous-segment context and vocabulary hints. Defaults retain beam size 5 and previous-segment context off. Corrected lyrics bypass model loading. Outputs are draft text and approximate segment times relative to the input selection; sung words still need review.

It uses the Transformers runtime provided by ComfyUI and official Whisper weights/processor assets beneath the configured audio_encoders paths. Download missing model defaults on: the first transcription downloads missing openai/whisper-large-v3-turbo files into the first configured model folder. Existing complete models load offline; incomplete Turbo folders with weights are repaired in place. Disable this control for local-only use. Other model names require a local installation. Corrected lyrics skip loading and downloading entirely.

Apex Optional Images grows sockets as images are connected. Empty inputs return count 0 so a workflow can skip that optional track. Saved socket order and the next empty input are repaired on reload, including groups with more than ten images. Apex V1 Cut Window reads actual saved V1 joins; use its start and duration for both the audio crop and B-roll placement.

LTX 2.5 PromptRelay workflows

PromptRelay remains a separate dependency: kijai/ComfyUI-PromptRelay. For the LTX 2.5 global/local workflows, Apex supplies an explicit compatibility patch for Gemma 4 token alignment, appended guide masks and scoped mask cleanup.

After installing PromptRelay from Git beside Apex, run with ComfyUI's Python:

python custom_nodes/comfyui-apex-artist/scripts/apply_promptrelay_ltx25.py --apply

Without --apply, the command only checks compatibility. It preserves already-applied changes and rejects different source before writing. Restart ComfyUI afterward. This helper does not install or download the dependency.

Timeline editor

The editor is embedded in the node. Resize it for more space. It outputs VIDEO, IMAGE, AUDIO and FPS, followed by project metadata. Connect VIDEO to native Save Video, or IMAGE/AUDIO/FPS to a video-combine node. IMAGE materializes frames only when connected; video-only exports keep frames on disk. Final saving uses the downstream node's encoding settings. Export queues every connected save/combine output using its own encoding settings and reads the saved timeline without regenerating clips. Trimmed cuts are normalized into reusable disk-backed CFR segments before concatenation, so export timestamps follow the project frame grid without loading the whole film into RAM. During clip generation, route save nodes through End Loop so they cannot escape the loop body.

Capture and placement

  • Each VIDEO input maps to the same numbered video lane: Video 1 → V1, Video 2 → V2. Repeated captures append to that lane.
  • placement_start = -1 appends at each receiving track's end. A non-negative value sets an explicit start. placement_offset adds seconds to that computed start for each incoming clip; 0 adds no gap.
  • New Results Only rejects identical media already captured on the same track. The target defaults to 180 seconds; overflow is retained in the review bin.
  • Native loop/math nodes can drive ordinary inputs. Connect a loop's is_last to prepare_outputs to assemble only its final iteration. Loops retain the editor's persistent project identity.
  • + Track exposes its VIDEO socket. Connecting the last socket grows a matching lane/socket, up to sixteen tracks. Disconnecting keeps edits intact. V1 is permanent; other lanes have a small minus button with deletion confirmation and undo support.

B-roll cut windows

Apex V1 Cut Window reads saved V1 clip starts from the named timeline and node ID. Generate the main-track clips first, then select a zero-based join index, B-roll duration and lead before the cut. Connect its start to both audio cropping and timeline placement, and use its duration to trim the generated clip. Windows align to project frames and stop at the end of V1. Each execution rereads the saved timeline so edited joins are reflected.

Editing and playback

Drag clips between tracks, trim edges, set numeric positions/source trims, split, duplicate or delete. Undo/redo persists. Higher video tracks cover lower tracks. Gaps show black; enabled audio lanes mix independently of the visible video layer.

Video audio receives linked audio placements. The optional master AUDIO input becomes an editable clip on A1. Disable capture_clip_audio when the master should supply the soundtrack. Timing edits affect linked video/audio until unlinked. Audio lanes support mute and gain: drag the thin waveform line from 0–200%, double-click to reset to 100%, or focus it and use Up/Down/Home. Waveform height follows gain.

Project FPS defaults to 24. Scrub the ruler/playhead; Space toggles playback, Left/Right steps frames and Home/End jumps to boundaries while the editor has focus. Text and numeric fields retain their normal keys. Fit sits beside zoom. Clip actions are before Export. Wheel input scrolls editing panels and reaches canvas zoom over the preview/background.

Video/audio edge handles control fades. Zero duration means full opacity/gain. SNAP aligns edits to the visible time grid, playhead and clip boundaries; disabling SNAP allows overlap and automatic join fades. Preview preloads the next visible clip for hard cuts. Mixed sizes and frame rates are normalized during rendering, leaving linked originals unchanged.

Save Project exports timeline state as JSON with media links. Open Project opens a separate editable copy; the workflow-owned project remains unchanged. The editor width remains stable after using property-panel controls.

Storage and export

Projects and captured assets persist under:

<ComfyUI output>/Apex/timelines/<project>/

Legacy projects under user/apex_artist/timelines are copied on first open; originals remain. Link clips and external drag/drop reference original absolute paths without copying. If the browser hides a dropped path, use the local source picker. Audio files can be linked directly to audio lanes.

Missing sources remain red with their edits intact. Right-click to locate one or search a folder, optionally including subfolders. Ambiguous matches stay unresolved. Missing media blocks export until repaired.

Export queues the connected save path using saved placements, fades, mute and gain. It does not regenerate source clips or reload the original audio loader. Clear video cache removes regenerable MP4 cache files only while the ComfyUI queue is idle. Source media stays intact. Audio/waveform caches have count limits; video caches are cleared explicitly.

Inside a native loop with cache_iterations off, a successful timeline capture releases completed upstream clip results once no pending node needs them. Shared cache entries, carried values and explicitly cached iterations are preserved. Normal ComfyUI caching stays enabled; no cleanup node or launch flag is needed. This prevents finished frame batches from accumulating between captures.

LoRA and HDRI previews

The LoRA browser lists all configured roots and generates 256×256 JPEG thumbnails. Changed source previews regenerate thumbnails; asynchronous results stay matched to the selected model. Duplicate relative names follow ComfyUI's earlier-root precedence. Keep original preview images if you need their full quality.

The HDRI viewer uses source panorama metadata for its interactive preview. Connect IMAGE and execute once for a socket preview; the bounded 8-bit preview approximates the source while final outputs retain tensor dynamic range. Drag to aim, Shift-drag to roll and scroll to change FOV. Unchanged views reuse the rendered frame. OpenCV provides HDR/EXR decoding; panoramas cannot reveal unseen geometry or true parallax.

Development and release

Version 2.6.5 adds stable audio-derived filenames, explicit memory cleanup, independent music-video timing and scoped uncached-loop optimization. See CHANGELOG.md for changes and validation limits, PUBLISH.md for release steps, and system patterns for architecture.

Run the portable CPU regressions with the ComfyUI Python environment:

python -m unittest discover -s tests
python scripts/generate_character_presets.py --check

Check each web/*.js with node --check. These checks do not replace a live ComfyUI smoke test or clean-install test. No GPU performance benchmark is claimed.

MIT licensed; see license.md. Issues and contributions are welcome on GitHub.

Music-video timing preflight

Apex Music Video Plan checks durations, independent song-relative start offsets/gaps and optional reference counts before the render loop. B-roll and C-roll do not read singer cuts, other clips or saved timelines. Each optional lane uses its own start offset plus its index times (its own duration plus gap); its last window is trimmed at the song end. An offset at or beyond the song end skips that lane. Zero gaps are valid; negative offsets/gaps and zero-frame used durations are rejected. Use aligned song/singer durations together with the returned pass counts. Missing references disable their lane. Candid duration retains the workflow's 3–5 second range; it no longer depends on room around a singer or instrument edit.

Apex V1 Cut Window reads visible V1 changes on the editor's frame grid. Upper tracks do not alter these cuts. Overlaps follow the editor's last-placement-wins order, zero-frame tails are ignored, and black gaps are not treated as picture-to-picture joins. B-roll can span multiple A-roll clips and is trimmed at the end of V1. Timing must leave at least one frame before and after the selected cut. Editing V1 during an automatically scheduled render can change the number of joins; regenerate the plan before resuming rather than assuming the original count still applies.

Timing validation does not guarantee model VRAM requirements, third-party extension behavior or interruption recovery. Saved media and project files remain the recovery source.

The plan also installs compact keys on this executor's output cache for expanded descendants of its own uncached native Start Loop. Native uncached iterations already cannot reuse results across prompts; shared preparation and ordinary nodes keep native input signatures. This avoids repeatedly flattening all previous iterations into each key before the first clip. It changes no core files or launch flags. Explicit iteration caching remains native. The adapter checks the current private cache layout and fails clearly on an unsupported layout instead of guessing. Native classic, LRU, RAM pressure and disabled caches have focused regressions. See the related open upstream loop cache-key PR; this scoped implementation does not include that PR's general cached-loop changes.

For this fresh-generation music plan, leave Cache Iterations off as in the original workflow. The plan rejects an enabled or linked iteration-cache policy before video generation. Other workflows and their explicit cached loops keep native behavior; this is separate from ComfyUI's normal shared-model/preparation cache.