Commit Graph
27 Commits
Author SHA1 Message Date
Jason HokuandClaude Fable 5.1 198138e51c perf(encode): prepare the text encoder once per pre-encode loop, not once per prompt
ComfyUI's CLIP.encode_from_tokens() calls load_model() -> model_management.load_models_gpu()
on every encode. With the dynamic VRAM loader (comfy_aimdo, 0.4x+) that re-runs
ModelPatcherDynamic.load() for a model that is already resident: a walk over every module plus
free_memory bookkeeping, visible as one

    Model MOSSImageTEModel_ prepared for dynamic VRAM loading. 7002MB Staged. ...

log line per prompt (N prompts -> N+1 lines). USCG's pre-encode paid it once per prompt, and
again on the single-encode paths (model switch, distributed, upscale, Florence2 hires).

Measured on the 5060 Ti (ComfyUI 0.42.5), MOSS-Image TE = Qwen3.5-9B w4a8, same process state:
  template path (CLIPTextEncode), per prompt ....... 0.92 s   (re-prepare every encode)
  USCG batch encode with pinned_clip, per prompt ... 0.84 s   (one prepare per pass)
  USCG job, 21 prompts + 21 one-step images ........ 36.8 s -> 33.0 s
  for scale: SDXL 0.15 s, Krea 2 0.29 s, Qwen-Image 0.32 s per prompt on the template path
The rest is the encoder forward itself: ~0.55 s fixed + ~2 ms/token for Qwen3.5-9B (24 of its
32 layers are Gated DeltaNet run through the pure-torch chunked recurrence, fp32 compute), so
a 60-prompt MOSS grid still spends ~50 s encoding before the first image. That part is
identical to the official workflow.

batch_encoding.pinned_clip(clip, texts): load once through load_model() (sized by the longest
text so any memory estimate still runs), shadow clip.load_model with a no-op for the block,
restore on exit or exception, nesting safe. encode_pair_cached(): positive+negative with one
load, nothing when both are cached. The pre-encode summary line now prints total time and
ms/prompt.

Applied to batch_encode_with_cache, the model-switch pre-encode in the main loop, the
distributed group pre-encode and per-job encode, the deferred-upscale re-encode fallback, the
dashboard upscale runner and the Florence2 hires step.

Tests: tests/test_pinned_clip.py (10) against the real batch_encoding module; the conftest
stub gained pinned_clip/encode_pair_cached. 137 passed, same 15 pre-existing torch-stub failures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-03 22:16:43 -08:00
Jason HokuandClaude Fable 5.1 e17021ee8c fix(moss): empty latent follows the model's latent ratio; moss_image CLIP type; Skip Layer Guidance option
MOSS-Image (Flux.2 latent: 128ch, 16 px per cell) jobs were built with the
SD-era `h // 8`, so every image sampled a latent with 4x the cells and decoded
at 2x the requested size (832x1216 -> 1664x2432): ~10x slower than the official
ComfyUI template (~120 s vs ~10 s per image on the 5060 Ti).

- model_loader: get_latent_downscale_ratio() reads latent_format.spacial_downscale_ratio
  (8 for SD/SDXL/Flux.1, 16 for the Flux.2 family); make_empty_latent() builds the
  job latent and warns when WxH is not a multiple of the ratio. Both orchestrator
  latent sites (main loop + distributed worker) use it; hires-fix latent upscale,
  tiled hires sampling and VAE tiling divisors no longer assume 8.
- CLIP type: resolve_clip_type() warns on unknown types instead of silently using
  stable_diffusion, and when clip_type is left at the default it follows the
  detected model family (MOSSImage -> moss_image, Flux2 -> flux2, ...). MOSS loaded
  as a generic Qwen3.5 TE before (wrong chat template). The Builder's CLIP Type
  list is now read from ComfyUI's CLIPLoader/DualCLIPLoader (static list = fallback,
  now including moss_image); LS_CACHE_VERSION 3 refreshes cached lists.
- Skip Layer Guidance: new Extra Model & Sampling sub-group wrapping
  SkipLayerGuidanceDiTSimple (double/single layers, start/end %), plumbed like Deep
  Shrink (builder emission, expand_configs, orchestrator, generate_image). Defaults
  match the official MOSS-Image workflow (single block 22, 0-50%).
- tests: latent geometry + clip type resolution, dynamic clip type lists, SLG
  config emission/expansion (24 new; the 15 pre-existing torch-stub failures unchanged).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-03 20:23:10 -08:00
Jason Hoku 246111cede docs(readme): add ComfyUI-USCG-CivitAI to Companion Plugins section
Third companion plugin in the extraction series. Completes the cleanup —
main USCG now has zero yara findings and should pass Comfy Manager
submissions without manual review.
2026-05-19 19:02:05 -07:00
Jason Hoku dbc10089a9 docs: update /distribution/* references to /uscg-distribution/*
Phase 2 renamed the routes to /uscg-distribution/* during the extraction
of the Distributed companion plugin. ProjectStructure.md (8 occurrences)
and README.md (6 occurrences) still referenced the old paths.

Caught alongside the worker URL bug during Phase C smoke test.
2026-05-19 15:55:22 -07:00
Jason Hoku dc8496985f docs(readme): add ComfyUI-USCG-Distributed to Companion Plugins section
Second companion plugin in the extraction series. Distribution moved out
of main USCG to clear the Comfy Manager scanner.
2026-05-19 15:36:24 -07:00
Jason Hoku d9f302be3b docs(readme): add Optional Companion Plugins section
Documents ComfyUI-USCG-RemoteVAE as the install path for HuggingFace
Remote VAE after the extraction refactor.
2026-05-19 13:26:13 -07:00
Jason Hoku 6ab8eb64af docs+bump: README — add Florence2 Hi-Res Fix section + v1.21.0 -> v1.22.0 2026-05-18 01:40:14 -07:00
Jason Hoku 7e0d3b20b2 docs: Quick Start section with 3-node diagram and basic workflow link at top of README 2026-04-22 17:33:51 -07:00
JasonHokuandClaude Opus 4.6 fc6137462d docs: restore project documentation to tracking
Re-add AI-CONTEXT.md, ProjectStructure.md, README.md, and Roadmap.md
to git tracking. Only docs/plans/ remains gitignored as local-only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:34:28 -07:00
JasonHokuandClaude Opus 4.6 6d1fcdb87f chore: gitignore local-only docs and remove from tracking
ProjectStructure.md, README.md, Roadmap.md, AI-CONTEXT.md, and docs/
are local development references — not needed in the repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:32:37 -07:00
JasonHokuandClaude Opus 4.6 989da199a3 Update README.md and ProjectStructure.md for v3.0
- Add distributed processing features (multi-worker, master text
  encoding, model sync, per-worker logging)
- Add comprehensive AI development notes with architecture diagrams,
  file dependency graphs, gotchas, and testing instructions
- Update file structure to include all 21 Python modules, distribution
  files, and conf-builder-distribution.js
- Add distribution API routes reference
- Add distribution module descriptions and communication patterns
- Update data flow to include distribution pipeline
- Add 8 new critical development gotchas (13-20)
- Add new changelog entry for March 2026
- Bump version to 3.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:08:34 -08:00
JasonHoku 048ee3ca1b Update Readme & Project Structure 2026-02-16 14:56:26 -08:00
Jason Hoku 24acfb2ad1 Update README.md add pics 2026-02-13 16:35:10 -08:00
JasonHoku 616aaeda89 Readme update, Comfy manager project description update 2026-02-13 15:37:23 -08:00
Jason Hoku 6257fbeb98 Update README.md 2026-02-10 16:38:32 -08:00
Jason Hoku 06f3f8b5db Update README.md 2026-02-10 16:37:25 -08:00
JasonHoku 47cc06fb33 Config Builder Add Multi Lora & Model Loading Features For Folders & Multi Selections, Add Lora Trigger Tag Lookup & Omitting System 2026-02-07 00:18:43 -08:00
JasonHoku 9d1afab458 Major Refactor, Optimizations & New Features: Move & MetaPack Favorited, Random Lora Selection, Lora & Model Entire Folder Loading, Smart JSON Node, WIP Config Builder 2026-02-06 00:07:47 -08:00
Jason Hoku 940d615e5d Update README.md 2026-01-19 14:43:55 -08:00
JasonHoku e22a28e389 Update README.md 2026-01-13 13:57:33 -08:00
JasonHoku 62309f47be Improve readme into description 2026-01-11 19:48:15 -08:00
JasonHoku 762078657a Massive Overhaul, Refactoring, Optimization, Auto Loading/Unloading Virtual Pagination Of Images, Fullscreen Mode, Multi-Models, Multi-Loras, Multi Seed, Stop & Resume Detection, Spacebar Pan To Next Row & Update Grid After X Images Feature 2026-01-11 19:18:26 -08:00
JasonHoku cb597b7bd5 Readme for multi prompting 2026-01-08 18:40:33 -08:00
JasonHoku ba69c48206 Refactor html_gen, better dashboard panning, better config JSON error reporting, fix optional vae not overriding decode, and accept stacking loras and lora arrays for iteration 2026-01-07 22:44:26 -08:00
Jason Hoku 95a59ae161 Update README.md add more examples 2026-01-07 00:08:00 -08:00
Jason Hoku b969dbc957 Update README.md 2026-01-06 20:39:50 -08:00
JasonHoku 926798a412 Initial release of Ultimate Auto Sampler Suite 2026-01-06 20:22:33 -08:00