Commit Graph

536 Commits

Author SHA1 Message Date
CalamitousFelicitousness c04fe7c9db fix(video): exclude dropdown separators from model resolution
The registry helpers filtered only the 'None' placeholder, so the eleven
LTX separator rows resolved as models and a POST naming one reached
load_model with a null repo. is_model() now covers both sentinel kinds.
2026-08-14 01:14:27 +01:00
CalamitousFelicitousness 3e8f0372ad feat(video): condition minimax h3 ref2va on reference images
The ref2va checkpoint partition conditions on reference images instead
of keyframes, so it gets its own registry row and reference card, and
the video core marshals PIL images into task_args as
MiniMaxH3ImageReference. Images are converted to RGB first, since the
reference encoder reads the array raw. The keyframe path is unchanged.

Validation runs before the model load in one funnel shared by the tab
and the API, so a rejected request costs nothing: references on a
non-reference model, a reference model with nothing to condition on,
more than nine images, non-images, and aspect outside 1:4 to 4:1 all
return 400. The image path rejects a reference pipe without references
instead of reaching a transformer that was never loaded.
2026-08-10 22:14:18 +01:00
CalamitousFelicitousness ff42f1631c feat(api): add video generation endpoint
Add POST /sdapi/v1/video plus GET /sdapi/v1/video/models and
GET /sdapi/v1/video/file. The generation body is extracted from the
gradio handler into a keyword-only core, video_run.run, which returns a
structured result and raises typed errors; the positional generate
signature is unchanged and now adapts to the core. Omitting engine and
model drives the currently loaded checkpoint when it is video-capable,
which covers models loaded from local folders without a registry entry.

- registry helpers in models_def (find, engines, pipeline_classes,
  workflow_for_class); validate_pipeline reuses the shared class set
- modular pipes stamp their workflow so out-of-registry loads dispatch
  onto the modular branch
- disk switches (mp4_*) and wire switches (send_*) are independent;
  artifacts above the base64 cap fall back to path plus the file route,
  which is jailed to the video output directory and serves video/mp4
  with range support
- always-on video scripts get bootstrapped default args, matching the
  txt2img handler; missing bootstrap raised a TypeError per frame
- checkpoint overrides are rejected with a pointer to the checkpoint
  endpoint; unknown engine, model and sampler names return 404 with the
  valid choices
- cli/api-video.py client, test/test-video-api.py suite and a
  full-test.sh entry; video mimetypes registered; rate-limit cost set
- remove the unreferenced video_ui.run_video dispatcher
2026-08-10 22:14:18 +01:00
CalamitousFelicitousness d38f2c97b2 feat(monitor): report model placement in the memory monitor
Move the per-component placement walk from the api server into memstats
next to ram and gpu stats, and add it to the --monitor tick so offload
placement is visible in a log rather than only over the api.

- guard the walk internally: the supervisor loop logs its monitor line
  unguarded, and the walk can race a reload or an offload rewrap
- monitor reports gb and merges into a fresh dict, since memory_stats
  returns a module global that the per-generation log also prints
- endpoint keeps reporting raw bytes
2026-08-10 22:10:42 +01:00
CalamitousFelicitousness b12cbcb523 feat(api): report model memory placement in memory endpoint
Add a model section to /sdapi/v1/memory with loaded-model bytes summed
per pipeline component and device, so clients can tell resident weights
from offloaded ones and loop-critical components from edge ones.

- walk components over parameters and buffers, dedupe shared storages,
  key by component name then device type
- read the raw model slot so a memory poll never triggers a model load
- section is exception-isolated like ram and cuda; reports an error
  string if the walk races a reload
2026-08-10 22:10:42 +01:00
Vladimir Mandic ccb048a9af fix api-control
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-10 20:43:50 +02:00
CalamitousFelicitousness adf0385c52 fix(sampler): record and restore Default instead of the None sentinel
The keep-current-scheduler sentinel leaked into user-facing surfaces:
infotexts and filenames recorded Sampler: None, restoring such an
infotext pushed an invalid value into the dropdown, and the API
samplers list never offered Default at all.

- infotext always records the sampler, mapping a stray None to Default
- parse maps legacy Sampler: None infotexts to Default
- api samplers list leads with Default; the remaining excluded config
  keys are shared templates, not samplers
2026-08-10 02:44:56 +01:00
Vladimir Mandic ca955ba1c2 update handlers for all authenticated workflows
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-09 22:47:17 +02:00
Vladimir Mandic a882ce945b detailer.next
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-09 15:05:00 +02:00
Vladimir Mandic 84905f77da improve server monitor and profiling
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-05 12:19:07 +02:00
Vladimir Mandic 514a68b1af add storage analyzer
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-02 11:22:12 +02:00
Vladimir Mandic 9dec85040e video: support for scripts/extensions
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-28 10:43:58 +02:00
Vladimir Mandic 3a9ebc3494 process add video info and metadata
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-19 14:37:20 +02:00
CalamitousFelicitousness ccb339bf0f feat(caption): add toriigate 0.5
ToriiGate 0.5 is a Qwen3.5 vision fine-tune trained on a single system prompt
and a single query structure, and it degrades on anything else. The shared qwen
handler strips angle brackets and underscores from the question, which mangles
the model's format templates, and the generic caption instructions are not what
it was trained on.

- hold the model's caption formats, system prompt and query builder in modules/caption/toriigate.py
- build the system prompt and user query from those templates in the qwen handler
- offer the native formats in the task dropdown and in the caption api prompt groups
- drop Normal Caption for this model, which has no format between short and long
2026-07-15 01:36:12 +01:00
Vladimir Mandic f8cfc408e9 strict subpaths
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 21:48:42 +02:00
Vladimir Mandic f829f2d776 fix infotext
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 20:58:33 +02:00
Vladimir Mandic 03473c1316 add loaded-loras api endpoint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-12 13:10:35 +02:00
Vladimir Mandic f4348bcb69 server info handle multi-gpu
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-09 11:18:04 +02:00
Vladimir Mandic 3158468dc4 add server restart api endpoint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-08 10:09:36 +02:00
Vladimir Mandic 4bd0c39133 lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-04 15:31:58 +02:00
Vladimir Mandic 98a7d17207 linting
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-03 22:05:33 +02:00
Vladimir Mandic a4d107a919 refactor detailer
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-03 21:03:28 +02:00
Vladimir Mandic 51a0eaaa21 add experimental openai interface
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-02 14:36:44 +02:00
Vladimir Mandic 6fc0830d2c api audit
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-01 11:47:29 +02:00
Vladimir Mandic f4dd9bd063 fix openapi schema
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-01 11:23:07 +02:00
Vladimir Mandic 743d585faa audit: api response models
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-01 11:19:55 +02:00
Vladimir Mandic 2ad76fecb6 audit: api signature
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-01 11:17:01 +02:00
Vladimir Mandic f44dd11b05 fixes
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-26 21:30:09 +02:00
Vladimir Mandic 138125bd46 update api response models
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-26 10:39:33 +02:00
Vladimir Mandic fccbdcc1e9 update api response
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-26 10:38:14 +02:00
Vladimir Mandic 913f1ca9ee improve gallery performance
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-22 12:16:18 +02:00
QualiaRain 711d6018bf fix(api): IP-adapter mask accumulation, null params, colon-in-password, raw allowed path
generate.py: p.ip_adapter_masks was reinitialized inside the per-adapter loop, discarding all but the last adapter's masks; move it beside the other accumulators. process.py: req.params is dict|None, so a null params body crashed .items() in post_preprocess/post_mask. api.py: split(':') without maxsplit broke auth/auth-file entries whose password contains a colon. gallery.py: allowed_paths stored quote(path) but the membership check and path guards use the raw path, causing duplicate accumulation and an ineffective whitelist; also drop the unused FastAPI import (pylint W0611 surfaced when this file is linted).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 15:20:07 -04:00
CalamitousFelicitousness e804d6df21 feat(samplers): group sampler dropdown into labeled sections
Reorder samplers_data_diffusers into recognizable solver-family groups (Euler, DPM/DPM++, UniPC/DEIS, Heun/KDPM2, ER-SDE, Classic, Distilled, Misc), each ending with its FlowMatch variants, and Res4Lyf as a fenced experimental section, so the dropdown is scannable.

Dividers are SamplerData sentinels with U+2500 names: create_sampler keeps the current scheduler when one is selected, get_sampler_name falls back to Default, set_samplers and validate_sampler_name exclude them, and a visible_samplers() helper drops them from the xyz axes, detailer, and folder pickers. The main and refine dropdowns render them as section labels. No sampler is removed or renamed, so saved infotexts, styles, and API calls keep resolving.
2026-06-14 01:41:05 +01:00
QualiaRain 584f2b84c4 fix cli+api: data-uri decode guards, mutable default, caption/ffprobe/palette IndexError guards
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 13:00:23 -04:00
Vladimir Mandic fefa1f210d fix sdnq svd
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-08 10:12:17 +02:00
CalamitousFelicitousness 72b6691fd6 fix(api): default img2img sampler_name to Default like txt2img
img2img still defaulted sampler_name to UniPC after the txt2img default was switched to Default in 7fbac675f, so an img2img request that omits the sampler forced UniPC instead of keeping the model's own scheduler. The control endpoint already used Default; align img2img with both.
2026-06-07 06:57:07 +01:00
CalamitousFelicitousness 0c0d455c11 fix(api): resolve sampler names case-insensitively to canonical form
validate_sampler_name only matched the exact, case-sensitive name, so near-miss client names such as lowercase variants were rejected while an omitted name silently used the model scheduler via the Default sentinel. Fall back to find_sampler and return the canonical name so create_sampler applies the intended sampler; unknown names still return 404. Add an API test covering case-insensitive resolution and rejection of unknown names.
2026-06-07 06:57:07 +01:00
Vladimir Mandic 5e99dee3c2 full codespell coverage
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-04 12:36:10 +02:00
Vladimir Mandic f25f325efb fixes based on full skills run
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-04 11:10:26 +02:00
Vladimir Mandic 3c2a742f40 cleanup logging
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-02 08:03:27 +02:00
CalamitousFelicitousness f9ab0bf04d feat(api): add detailer postprocess script and /sdapi/v1/detail endpoint
Surface YoloRestorer.restore() as a standalone operation: a Detailer
postprocessing script in the Process tab and a thin /sdapi/v1/detail
endpoint, neither requiring a base generation pass.

- modules/postprocess/yolo.py: YoloRestorer.make_processing() builds the
  synthetic Img2Img processing object both entry points feed to restore(),
  resolving the seed so the inpaint passes are reproducible
- modules/api/process.py: post_detail handler exposes the full detailer
  parameter set and returns the detailed image plus optional annotations
  as base64
- scripts/postprocessing_detailer.py: reuses shared.yolo.ui('extras') and
  runs through make_processing()
- modules/postprocessing.py: run_extras takes a per-script script_args
  dict, also letting the extras API drive other scripts such as Remove
  background; omitting it leaves existing callers unchanged
- modules/api/models.py: ReqDetail / ResDetail
- modules/processing_info.py: guard create_infotext's Image/Hires CFG
  reporting against an unset (None) cfg_image, matching the is-not-None
  checks the other cfg_image readers use; the detailer inpaint pass runs
  with it unset
- test/test-detailer-api.py: covers both paths; effect tests measure the
  diff inside the detected region with extreme isolated parameter values,
  and the suite disables model quantization for the run and restores the
  original settings afterward
2026-06-01 00:25:59 +01:00
Vladimir Mandic 082498e6bd prompt-enhance-v2 with steering
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-22 16:58:23 +02:00
Vladimir Mandic 4b2f38ab7f complete refactor javascript to typescript and reorg frontend files and folders
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-20 18:08:10 +02:00
Vladimir Mandic a56d1d299e add wildcards to image metadata and note separate template from prompt field
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-19 09:45:20 +02:00
Vladimir Mandic 8bf7ddffe3 caption: add image analyze
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-14 13:16:26 +02:00
Vladimir Mandic 22a8af0c89 skill check-api
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-13 11:44:32 +02:00
Vladimir Mandic c8d6fd5cf8 Revert "much stricter ruff linting"
This reverts commit 310dbf1574.
2026-05-11 08:13:57 +02:00
Vladimir Mandic 310dbf1574 much stricter ruff linting
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-11 07:15:37 +02:00
Vladimir Mandic fad9015270 fix vae preview flash previous image
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-09 17:09:55 +02:00
Vladimir Mandic 54ad469919 models and hfcache tables
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-08 13:58:35 +02:00