Skip to content

feat(comfyui): Model Console mode for ComfyUI apps, with installable model groups - #18

Merged
pengpeng merged 8 commits into
mainfrom
feat/comfyui-console-groups
Nov 15, 2026
Merged

pengpeng merged 8 commits into
mainfrom
feat/comfyui-console-groups

Conversation

@pengpeng

Copy link
Copy Markdown
Member

Summary

  • Add a Model Console mode for single-workflow ComfyUI apps (llm-init comfyui): reads the app's app-config.json, downloads the models into the shared ComfyUI model folder with sha256/size checks, probes ComfyUI and serves /api/status and a status page.
  • Fetch large models over parallel byte ranges, each range on its own HTTP/1.1 connection; fetch huggingface.co models through HF_ENDPOINT.
  • Installable model groups: app-config.json may list groups (e.g. one per precision) next to the shared models.
    • COMFY_GROUPS ("", all or a comma list) seeds the selection; COMFY_SELECTION_FILE keeps it across restarts and wins over the env.
    • PUT / DELETE /api/groups/{id} download or remove a group. Removing cancels its running download and deletes only files no other selected group needs; the last group cannot be removed (409).
    • /api/status gains groups with state and progress; ready means the shared models plus at least one selected group are done.
    • The status page gets a "Model sets" section with Download / Delete.

Test plan

  • go test ./internal/comfyconsole/... (20 runs, 5 with -race), including group selection, validation, add/remove through the handler and cancelling a running download
  • Image built by docker-manual: docker.io/beclab/llm-init:comfyui-groups-20261115 (sha256:b6a8914400cc4df0bab19970e5ca1da744d53423d88594621ce7f29137750b6f)
  • On an Olares One with FastH3 Studio (flowstudio2): install with nvfp4, download int8 from the app, generate with int8, delete int8 (only its files removed, selection persisted), deleting the last group refused

pengpeng and others added 6 commits November 7, 2026 00:52
llm-init comfyui downloads the models listed in a JSON app config into
ComfyUI's model tree with resume and sha256 verification, re-fetches a
model that disappears, probes ComfyUI's /system_stats, and serves
/api/status plus a progress page. The LLM mode is untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hugging Face's CDN caps each connection (about 1.6 MiB/s on the test
box) while six connections reached 9.5 MiB/s. Models of 64 MiB or more
now download as COMFY_DOWNLOAD_CONNECTIONS ranges written in place,
checkpointed so a restart resumes each range; an upstream that ignores
Range falls back to the single-stream downloader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Over HTTP/2 the ranges multiplexed onto one TCP connection, so the CDN
throttled them as a single stream (2.1 MiB/s with 8 ranges against 11
MiB/s for 6 separate connections on the same file).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AppConfig gains optional groups (e.g. one per precision) on top of the
shared models. The installed groups live in COMFY_SELECTION_FILE, seeded
from COMFY_GROUPS on first start. PUT/DELETE /api/groups/{id} add or
remove a group: removal stops a running download and deletes the files
no other installed group uses, keeping at least one group. /api/status
reports groups; ready needs the shared models, one installed group and
ComfyUI. The console page lists the groups with download/delete.

Co-authored-by: Cursor <cursoragent@cursor.com>
…behind it

Co-authored-by: Cursor <cursoragent@cursor.com>
if err != nil {
return err
}
defer f.Close()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The success path syncs and closes the file explicitly and returns their errors (lines 138–142). This deferred Close only runs when the function returns early with an error; the .part file is then resumed from its .part.json checkpoint on the next pass, so an error from this close cannot lose data the caller relies on. Leaving it as is.

pengpeng and others added 2 commits November 15, 2026 15:58
…up errors

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@pengpeng
pengpeng merged commit 7c576fd into main Nov 15, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants