Skip to content

Workflow & intercepted endpoints

This page describes endpoints that are intercepted or implemented by the workflow middleware (routes/workflow_routes.py), rather than registered as direct routes.

Userdata workflows

Per-user workflow list, save, load, and delete (compatible with Comfy Portal and API token/JWT):

Method Path / behavior Description
GET /api/userdata?dir=workflows or paths containing userdata/workflows List workflows (global + user-specific). Returns full file info.
POST Same base path Save workflow (body JSON). Filename from query file/name or body name.
GET .../workflows/{filename} Load workflow content (user file first, then global).
DELETE Same base path (with optional file name) Delete workflow. User can delete own; only admin can delete global.

/view (NSFW enforcement)

  • GET /view — Serves output/temp images. The middleware checks the requested file against the NSFW Guard for the current user (from JWT or API token). If the user has SFW enforced and the image is tagged or detected as NSFW, the response is 403 with body "NSFW content blocked for this user." or "NSFW Blocked".

/prompt (user tagging)

  • POST /prompt and PUT /prompt — The middleware tags the current username (from JWT or API token) so that NSFW Guard and other logic know which user is executing the prompt. The request is then passed through to ComfyUI's normal prompt handler.

Details (e.g. exact path patterns) are also generated by scripts/build_docs.py where applicable.