Repository navigation
feat: route models inside Freya and ship the studio worker - #11
Conversation
The UI update button pulls source but Freya skips the native rebuild step. Wire git pull + dotnet build into make targets and document the workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
Stop only ComfyUI to preserve git state, use fetch+reset with retries, and skip rebuild/restart when SwarmUI is already current. Co-authored-by: Cursor <cursoragent@cursor.com>
Clear root for OpenRouter operator rebuild while keeping prior UI tooling reachable. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace Compose/GPU UI default path with kube-rs studio, cloud+local generation router, and Civitai key install flow. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Freya operator Makefile/README; Compose SwarmUI updates already live under legacy/. Co-authored-by: Cursor <cursoragent@cursor.com>
Interactive mock/dev:mock path, lacquer mist theme, portrait icons, and suggest/session instruction packs with API assist enrichment for #9. Co-authored-by: Cursor <cursoragent@cursor.com>
Root compose moved with the operator cutover; Lint and Validate was failing with "no configuration file provided". Co-authored-by: Cursor <cursoragent@cursor.com>
Contain asset dest paths, allowlist Civitai download hosts, optional FREYA_API_TOKEN + tighter CORS, drop shell eval on asset Jobs, and fix external worker URL / Job phase / LoRA local backend wiring. Co-authored-by: Cursor <cursoragent@cursor.com>
Require bearer on protected GETs, wire apiTokenSecretRef and worker authSecretRef through the operator, and allowlist worker install hosts so cluster/Ingress deployments are not fail-open. Co-authored-by: Cursor <cursoragent@cursor.com>
Stop nginx from injecting the API bearer, allowlist FreyaModelAsset download hosts before attaching secretRef, and sanitize assist mode paths. Reword sample secret comments so Security Checks CI passes. Co-authored-by: Cursor <cursoragent@cursor.com>
Pass download credentials as authToken Bearer instead of a URL query param, and return sanitized worker install errors so reqwest URL Display cannot echo the secret. Co-authored-by: Cursor <cursoragent@cursor.com>
Refresh .env.example and local docs for operator/API keys; feature freya.png NL brand prompt in packs and builtins. Co-authored-by: Cursor <cursoragent@cursor.com>
Planner chat models were treated as image endpoints and /images errors were masked by a chat-modalities fallback. Sanitize model ids, surface ZDR/credits clearly, and return a visible local stub PNG. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Surface installable Civitai weights (LoRA/LoCon/DoRA/Checkpoint/TI/VAE) with thumbnails and a detail view that shows base-model family + related checkpoints. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the list/suggest card in the modal when GET /v1/civitai/models/{id}
fails (common in mock vs live ids) instead of blocking Favorite/Pin.
Co-authored-by: Cursor <cursoragent@cursor.com>
Prompt submit chats with Freya; generate/search/install become mode-gated tool actions via POST /v1/chat instead of a Generate CTA. Co-authored-by: Cursor <cursoragent@cursor.com>
Wire Studio sample to nginx Ingress host and point the external worker sample at an in-cluster Service/Endpoints reachable from kind. Co-authored-by: Cursor <cursoragent@cursor.com>
Settings shows VRAM/util from worker or host nvidia-smi; API adds /v1/worker/stats plus docker/systemd start|stop and enable|disable so local gens can be paused without breaking OpenRouter. Co-authored-by: Cursor <cursoragent@cursor.com>
Local GPU control and OpenRouter chat discovery need first-class Worker/API surfaces; rotate tokens in-UI and sync LE wildcard into kind so freya.dataknife.net matches fleet TLS. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Auto on an internal privacy/alignment/cost matrix, and add the Civitai queue, local worker setup, and studio UI on that path. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep alignment and cost fallbacks in packs/auto-models.json so the router, agent, image, and video defaults can change without another hardcoded table. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
Keep the continued studio work, leave the new host scripts in scripts/, and take the rules file that landed on main. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
Keep the CRD manifest as YAML, require the API bearer on /mcp, and stop empty persisted keys or a failed Secret read from replacing live credentials. Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
There was a problem hiding this comment.
Stale comment
Not approved. Cursor Bugbot reviewed this head and reported 2 new issues with 13 unresolved findings (including high-severity routing, MCP allowlist, and worker TLS items), so this needs human review. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router and Approver
Cloud enhance and a Llama agent suggestion were rewriting local scenes when alignment is uncensored or Show NSFW is on. The worker already forwarded the prompt unchanged. Cloud image providers still apply their own refusals. Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
There was a problem hiding this comment.
Stale comment
Not approved. Cursor Bugbot skipped on this head, but unresolved Bugbot findings remain on this PR (including high-severity routing, MCP allowlist, and worker TLS items), so this needs human review. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router and Approver
f15101f skipped the rewriter when alignment was uncensored or Show NSFW was on, so the worker got the raw line. Local generate always rewrites. Ordinary text uses the balanced Auto agent. Adult scenes use Cydonia or Dolphin Venice instead of Llama, Claude, GPT, or Gemini. Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
There was a problem hiding this comment.
Stale comment
Not approved. Cursor Bugbot skipped on this head, but unresolved Bugbot findings remain (including high-severity routing, MCP allowlist, and worker TLS items), so this needs human review. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router and Approver
MCP rejects an empty token and keeps a loopback host list. In-cluster clients are on that list. Public worker HTTPS keeps certificate checks. Compose does not publish the worker. The operator does not adopt a Secret it does not own. Series failures return an error. A chat pin no longer replaces the resolved image model. Stats no longer treat /health as inventory. Explicit generate phrasing renders. Gif and video questions do not. Adult rewrite retries the other uncensored model and still does not skip the rewriter. Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
A missing or refused rewrite was aborting local generate instead of sending the original scene. First-party openrouter ids stay as agent suggestions. Auto with pinned LoRAs restores a refused tool prompt. Food wording like chicken breasts stays off the adult writer. Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
There was a problem hiding this comment.
Stale comment
Not approved. Cursor Bugbot skipped on this head, but unresolved Bugbot findings remain (including a high-severity Unicode panic in the adult-scene scan), so this needs human review. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router and Approver
previous_word added one byte after a non-ASCII separator and panicked mid-character. Standalone MCP lists Service DNS hosts. Empty or * stays loopback. Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
There was a problem hiding this comment.
Stale comment
Not approved. Cursor Bugbot skipped on this head, and unresolved Bugbot findings remain (worker disable, health-stats fallback, and standalone MCP Host allowlist), so this needs human review. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router and Approver
Disable drops the worker client and a URL save does not
turn it back on. A {ok:true} health body is not stats.
Standalone MCP allows the public Ingress host. Empty or
* stays loopback.
Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b05f640. Configure here.
There was a problem hiding this comment.
Stale comment
Agentic security review of this head found one high-severity issue: MCP tool path parameters are concatenated into HTTP URLs without segment encoding, so a crafted
jobId/idcan reach other authenticated/v1POSTs (including token rotation) through the MCP wrapper.Sent by Cursor Security Agent: Security Reviewer
Enable stayed disabled unless settings.workerEnabled was strictly false. Disable's enabled:false was ignored, so a stale or missing flag left Enable grey while local generation stayed off. Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
BREAKING CHANGE: POST /v1/worker/enable and /disable are gone. A saved worker URL attaches the client. Local vs Cloud still picks whether generation uses the worker. Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>
There was a problem hiding this comment.
Stale comment
Agentic security review of this head found one new HIGH issue: worker download errors still log raw reqwest Display text, which can include Civitai/Hugging Face download URLs and query tokens. The earlier MCP path-interpolation finding on
civitai_cancel_jobis unchanged on this head.Sent by Cursor Security Agent: Security Reviewer
MCP gallery and job ids must be one [A-Za-z0-9_-]+ segment before they are placed on an API URL. `../` and `?` are rejected, so reqwest cannot retarget /v1/auth/token or worker start/stop. Worker download logs keep the sanitized status or transport error. reqwest Display includes the request URL and query token, so it is not logged. Co-authored-by: Lee Chapman <surrealwolf@users.noreply.github.com>



Summary
FreyaStudio, diffusion worker, and model-asset CRDs with OpenRouter, Civitai, and Hugging Face secret refs, generated admin/API tokens, and Ingress/RBAC for the studio path.openrouter/auto), and adds the Civitai install queue, gallery, and settings/auth APIs.Dockerfile.worker, setup scripts, Compose underdeploy/compose) plus external and in-cluster worker samples.freya-mcpStreamable HTTP server that proxies the Freya API for agents, with a standalone sample and operator wiring.Test plan
cargo checkthe API, operator, worker, and MCP cratesmake mock-uiand walk chat, gallery empty states, Civitai, and the Worker tabopenrouter/automake compose-up(andmake compose-up-gpuif a GPU is available)Made with Cursor
Note
Medium Risk
Touches authentication, Ingress-exposed MCP, operator Secret generation, and a large new API/worker surface; misconfiguration could leave routes open locally or break cluster token/MCP alignment.
Reviewed by Cursor Bugbot for commit a840e50. Bugbot is set up for automated code reviews on this repo. Configure here.