Closes the gap reported in #126 where local users hit "Not authorized:
missing or invalid credentials" on upload and couldn't generate video
locally even with WanGP installed. Image, video, and reference uploads
were all hard-wired to the Muapi-hosted upload endpoint, and Video
Studio had no branch into the local Wan2GP provider for generate.
- electron/wan2gpProvider: new wan2gp:upload-file IPC that POSTs to the
Gradio /upload endpoint, caches the returned path, and rehydrates it
into a Gradio FileData descriptor on generate. Adds wan2gp:wan22-i2v.
- preload + localInferenceClient: expose uploadFileToWan2gp(file).
- localModels: wan22-i2v entry, isWan2gpModelId, localT2VModels/localI2VModels.
- UploadPicker: accept optional uploadFn + requireApiKey so callers can
bypass the Muapi auth modal when the active provider is local.
- VideoStudio: merge Wan2GP video models into t2v/i2v lists, route the
reference-image upload through the local provider when a Wan2GP model
is selected, skip the Muapi key gate for local generations, call
localAI.generate, and surface step progress in the button label.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The desktop app already has a bundled sd.cpp engine for local generation. This
adds a second, complementary engine: an HTTP client that talks to a user-run
Wan2GP Gradio server (https://github.com/deepbeepmeep/Wan2GP). Useful when
sd.cpp can't run a target model — Wan2GP brings video models (Wan 2.2,
Hunyuan, LTX) and large image models (Flux, Qwen-Image) without bundling
Python or weights into the app.
Architecture
- Each model in the unified catalog now carries a `provider` field
(`'sdcpp' | 'wan2gp'`). The renderer's `localAI.generate()` routes to the
right backend based on that flag.
- sd.cpp keeps its existing IPC channels (`local-ai:*`) untouched. Wan2GP
gets its own channel namespace (`wan2gp:*`) and lives in its own
`electron/lib/wan2gpProvider.js`.
- Wan2GP server URL is persisted in `userData/local-ai/wan2gp.json`.
`Settings → Local Models` exposes a config bar to test/save the URL.
- Generation streams Gradio v4 SSE protocol; both engines emit progress on
the shared `local-ai:progress` channel.
ImageStudio
- Local-model dropdown now filters out video models (`type === 'video'`)
since the studio is image-only. SD 1.5 / SDXL / Z-Image (sd.cpp) and Flux /
Qwen-Image (Wan2GP) still surface; Wan/Hunyuan/LTX are hidden until the
Video Studio is wired up to the same surface.
- Progress event handler updated to tolerate both engines' shapes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>