552 Commits

Author SHA1 Message Date
Vladimir Mandic c2ce67418c fix prompt enhance api
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-24 09:00:02 +02:00
Vladimir Mandic 38324a198e more api cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-23 11:40:53 +02:00
Vladimir Mandic c5e29e3d7b api schema updates
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-23 11:28:50 +02:00
Vladimir Mandic c66342e2e6 fallback unpack-latents, log client auth, update login page
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-19 18:03:39 +02:00
Vladimir Mandic 1b13e732e0 add cookie-based auth for remote-ip
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-19 16:28:07 +02:00
CalamitousFelicitousness 2c66039c37 feat(video): derive input mode from the registry row
Two ladders decided how a model's inputs get wired, and they had drifted: the
api reported an unrecognized row as t2v while run() fell through to a branch
that wires nothing. Eight LTX condition rows sat in that gap, advertised as
text to video and generating without their conditioning.

dispatch_mode answers once from the row, reading name markers before the
pipeline class because one class serves several modes: six LTXConditionPipeline
rows are named T2V or I2V and generate as such. Rows that declare nothing now
resolve as condition, and the api reports that instead of guessing t2v.
2026-08-18 00:44:28 +01:00
Vladimir Mandic e23a70af34 fix processing api
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-17 18:07:06 +02:00
Vladimir Mandic f75e38c4ef krea2 optional dense masking
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-17 10:18:32 +02:00
Vladimir Mandic 9f650367cb multiple cleanups
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-17 09:35:07 +02:00
Vladimir Mandic 993fa4a2c6 Merge pull request #5031 from vladmandic/fix/video-codec-options
fix(video): correct codec option strings to the key=value form
2026-08-17 08:11:52 +02:00
CalamitousFelicitousness cce3a80b0c fix(video): correct codec option strings to the key=value form
parse_options reads : and , as separators and = as the only assignment, so a
segment without = becomes a valueless flag set to 1. The shipped strings used
ffmpeg command line spelling, which parses without error into other values.

- crf:16 parsed to {'crf': '1', '16': '1'}, encoding every api, framepack and
  seedvr video near lossless rather than at crf 16
- crf=23:b:v=0 pinned the generic bitrate option to 1 bit per second on vp8 and
  vp9, collapsing their output
- qscale:v=3 reached mpeg4 and mjpeg as nothing at all, replaced by an explicit
  quantizer range
- test-video-codecs.py asserts every preset segment carries an assignment
2026-08-17 03:04:59 +01:00
CalamitousFelicitousness 005fc5c86e refactor(video): accept video and audio references in the shared core
The core took reference images only, so no api caller could send the video and
audio references the ref2va workflow conditions on, and the marshalling that
handles them existed solely in the MiniMax tab.

validate_references now gates on the workflow and hands the entries to the
architecture that owns them, which accepts decoded images and local file paths
in any mix and preserves their order, since order fixes the labels a prompt
addresses. reference_caps exposes the same limits the validation enforces, so a
client reads them instead of mirroring the numbers.

- MAX_IMAGE_REFERENCES is gone: the limits now cover all three kinds and a total
- the run body no longer builds reference objects or knows their class
- an image is converted where it is built rather than at the call site, so a
  reference decoded from a file and one posted as base64 arrive the same way
- pipeline args summarize a reference list by kind, since a decoded video would
  otherwise print its frames into the per-generation log line
- the video endpoint documents what it actually accepts: images alone, because
  video and audio decode from files rather than from the wire, and an upload
  reference only where an extension provides the store that resolves one
2026-08-16 21:56:37 +01:00
Vladimir Mandic 6b499b7d17 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-16 19:00:55 +02:00
Vladimir Mandic 7172fd3eb2 api auth for ws and api validate allowed paths
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-16 18:57:26 +02:00
Vladimir Mandic e3c57af560 pipeline init reordering
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-16 12:45:50 +02:00
Vladimir Mandic 76941efc7e strict typechecking
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-16 12:45:50 +02:00
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