- reject metadata writes when the backing model file is missing
- use the REST result when the auto-organize progress socket fails
- add regression coverage and a progress fallback notification
Refs #1126
The bootstrap's absolutize branch tested `url.indexOf('http') === 0`, so a
ws:// URL matched neither branch: it does not start with '/' (the relative
branch) and it does not start with 'http' (the absolute branch). It fell
through and was returned untouched, which meant the WebSocket shim below it
was bypassed for every real WebSocket.
baseModelApi.js builds exactly that shape:
new WebSocket(`${proto}${window.location.host}${WS_ENDPOINTS.fetchProgress}`)
so under a reverse-proxy prefix the socket dialled the host root instead of
the prefixed path. Behind SwarmUI (/ComfyBackendDirect/), the root is answered
by the front-end router:
ws://host:7801/ws/fetch-progress -> 302
ws://host:7801/ComfyBackendDirect/ws/fetch-progress -> 101
A 302 fails the upgrade immediately, so showWithProgress() rejected and
auto-organize reported an error after the move had already succeeded.
Accept ws:/wss: in the absolutize branch and compare hosts rather than
origins -- a ws: URL's origin serialises as ws://host, never http://host, so
the origin comparison would have rejected the very case being fixed.
Behaviour change is confined to same-origin ws/wss URLs; external and
http(s) cases are unchanged.
Co-authored-by: Kai <kai@tigersden.net>
The auto-organize exclusions, metadata refresh skip paths and both
send-to-workflow exclusion textareas only committed on Enter, so clicking
away or closing the modal silently discarded the edit while the rest of
the settings modal autosaves.
Commit on blur and keep Enter as an explicit commit; Enter now just blurs
the field so every path shares one commit handler, like the filename
template inputs. Also flush on Escape, because Chrome does not fire blur
when the focused field is hidden by the closing modal. Skip the post-save
value write-back while the field is focused so a quick re-entry is not
overwritten by the in-flight request.
The bulk context menu showed two 1px lines directly under the "N selected"
header: .bulk-context-header already draws a border-bottom, and the
template additionally emitted a .context-menu-separator right after it,
4px below. Keep the header's own border and drop the redundant separator
so the header band is delimited by a single line.
The consolidation test asserted the raw POSIX value, but workflow_path is
normalized with os.path.abspath. On Windows that resolves the root-relative
'/workflows-a' against the current drive, so the Windows job failed with
'D:\workflows-a' != '/workflows-a'. Use the file's existing
_normalized_workflow_path() helper, as the other workflow_path tests do.
- Arm hover cycling only from the bare preview area; hovering the card
header or footer disarms the timer, so action buttons and tooltips
stay undisturbed
- Drop the activation delay from 1.5s to 0.8s now that chrome
interactions are protected structurally
- Revise cycle interval options to Fast (1.5s) / Normal (2s, default) /
Relaxed (3s), dropping the rarely useful 5s/8s choices
- Translate the updated cardPreview strings in all 9 locales
The fallback to config.loras_roots raised NameError because config was
never imported in that function. Use the same local import as the other
methods and add a test for the fallback.
- Shift+click "Send to ComfyUI" sends mode=replace, but mergeLoras keeps
the saved active flag of entries already in the list, so a listed but
disabled LoRA stayed off after the textarea was replaced.
- Call the shared enableListedLoras() after the merge, as the append path
does, so replace turns the target on and keeps its saved strength.
- Cover the path with the real mergeLoras in the send-to-comfy tests.
Based on the replace-mode coverage in willmiao/ComfyUI-Lora-Manager#1096.
Co-authored-by: Alexandre Zia <11000327+alexandrezia@users.noreply.github.com>
- Add a --full benchmark mode that selects the UI's 987-model default set
(lora/checkpoint/embedding) and copies the complete sidecar tree, plus a
longer poll timeout for full-library runs.
- Record the full run: 894.7 s versus the 1,164 s baseline (-23.1%), 7,404
files / 995.3 MB, 46 failed models, zero 429s, two probe steps.
- Record the 80-model / 729-image new-only comparison: pipeline -28.5% and
AIMD -49.4% versus new-serial, zero 429s. Document that the old serial
medium run was aborted after stalling on stale metadata at 13/80 models.
- Run a bounded model pipeline over the shared media limiter so model
preparation and failure bookkeeping overlap the previous model's tail.
New example_images_model_concurrency defaults to 2 (1 restores serial),
and metadata refreshes are serialized while media continues.
- Let the AIMD limiter probe one slot at a time above its base after a longer
success streak, up to example_images_download_max_concurrency (default 8).
A 429 still halves the limit below the base before recovery.
- Cache Civitai rendition -> blob redirects in Downloader.download_to_memory
for one hour (2048 entries, invalidated on 404), so retries skip the 301.
- Add scripts/benchmark_example_images.py, a reproducible old-vs-new A/B
harness that selects one cache/sidecar subset and runs serial, new-serial,
pipeline and aimd modes against the same temporary examples path.
- Document the measured results (19 models / 185 images, 3 repeats):
pipeline -23.4% vs new-serial, AIMD -22.2% vs pipeline, no 429s.
- Add an atomic .lm-examples-complete marker; only a folder with media and
the marker is skipped, so interrupted or legacy folders are re-checked by
the per-image existence path. Clear the marker before each pass.
- Treat processed/failed folders without a marker as pending so the
auto-download pre-check repairs them, and clear markers when provider
metadata is refreshed or custom images are imported.
- Bound stale-metadata refreshes at 90s so one hung provider cannot park the
serial run; count metadata-missing models as retryable.
- Record failure reasons in the progress file, expose failure_summary, and
render a no-media/unavailable/retry breakdown in the progress panel with a
warning completion toast.
- Add marker, partial-repair, timeout, failure-summary and UI tests.
`_DownloadProgress.snapshot()` converts the progress sets to lists, so their
order follows the process hash seed. The compact-status test compared them to
a fixed list and failed on CI whenever `{"a", "b"}` iterated as `["b", "a"]`.
Compare the contents instead.
Fill in the 19 settings.nav.about / settings.about.* keys in all nine
locales. Term choices reuse the existing UI vocabulary (metadataArchive
"Unavailable", support.links.joinDiscord, help.documentation, GitHub,
Browser) and follow the translation guidelines' register rules:
你/您, Sie, tú, вы. No [TODO: Translate] placeholders remain.
Move the version panel out of Help -> Documentation into a dedicated
Settings -> About section. It shows the LoRA Manager, ComfyUI, ComfyUI
Frontend, Python, OS and browser versions, copies the block as Markdown
for issue reports, and links to the issue tracker, wiki, GitHub and
Discord.
Read the values from a new GET /api/lm/environment endpoint instead of
ComfyUI's /system_stats: Python and OS stay available in standalone mode,
while ComfyUI-only versions are omitted there instead of failing the
whole panel. Model Paths is inserted before About so About remains the
last settings section in standalone mode as well.
The feature list in the help modal used the generic .help-text class. An
externally injected global .help-text rule (e.g. from a browser extension)
sets position: fixed and z-index: 10000, which pulled the list out of flow
and covered the modal tab buttons: the app's own rule never declared
position, so the injected declaration applied.
Rename the class to .help-features and scope its rules under .help-modal
so third-party global styles can no longer match it. Also close the
unterminated <a>/<li> pair in the documentation tab.
aiohttp already percent-decodes request.query values, so calling
urllib.parse.unquote() a second time turned a literal "%20" in a filename
into a space. Previews for files such as Female%20_nude.mp4 therefore
404ed, while renaming the file to use a real space masked the bug.
Use the decoded query value as-is and add regression tests for literal
"%20" and "%2F" filenames. Cached preview URLs need no migration: they
encode the percent sign once (%2520) and now resolve correctly.
pop_next_download(), get_queued_count() and get_history_count() had no
callers in the backend, tests or docs. The queue is drained client-side by
the companion extension (retry?start=true is the backend executor entry
point), so the half-wired pop helper only misled readers into thinking the
backend had a drain loop.
deduplicate() step 4 matched retried queue rows only by (model_id,
model_version_id), so a retry for one file was deleted on the next backend
start whenever another file of the same version still had a failed history
row. Compare the file identity as steps 1-3 already do (#1058).
GET /downloads/history/retry now accepts start=true to run the retried
download on the backend. The companion extension omits the flag and keeps
draining the queue itself, so clients without it no longer leave retried rows
queued forever.
- Blend a phase baseline with a 120s throughput window; reset the phase
on pause and skip bursts so a resumed run is not estimated from the
folders it skipped.
- Expose pause-aware elapsed_seconds and add a compact status response
for the 2s progress poll.
- Save .download_progress.json from both download loops; the old save
sat behind an early return on the common image path.
- Treat blank aiohttp errors and raised exceptions as transient, and
bound gallery media at 25s (videos 180s) instead of the shared 300s
socket read.
- Add tracker, manager, progress and timeout tests plus the full-run
measurements.
- Add a shared MediaDownloadLimiter (default 6 concurrent) with a per-run
429 cooldown and AIMD recovery; drop the empirical inter-model delay.
- Request width-aware Civitai renditions (800px images, transcoded 450px
videos) and map Genur signed/direct URLs to c.genur.art _small.webp or
_large.webp.
- Return an ImageDownloadOutcome so offline/connect/timeout/5xx failures
stay transient instead of being written as downloadFailed; track
retryable_models and leave those models pending.
- Force retries flagged Genur images and clears downloadFailed/downloadError
only after a successful write, through the normal metadata save/cache path.
- Force bypasses the populated-folder guard; success is false when flagged
images were skipped, so models are no longer falsely marked recovered.
- Add settings, tests, and a design/measurement note.
Cover settings.sections.cardPreview and settings.cardPreview.* in all
nine locales, so no [TODO: Translate] placeholder remains. The copy
reuses each locale's established card / example-image / preview nouns,
and the interval options keep the locale's unit notation (2 s, 2 секунды,
2 שניות, 2秒, 2초, 2 秒).
Extend the translation guidelines with the feature's status note and a
§2 rendering table so later passes keep the same terminology.
- de: use "Workflows-Seite" in the workflow path-template hint, matching
the copy in the folder settings
- fr: restore the ASCII apostrophes used elsewhere in the file
- es: replace the last two "Palabras clave" with "Palabras de activación"
Cards with a static image preview now crossfade through the model's
example images when the pointer rests on the card, giving multi-concept
LoRAs a richer at-a-glance signature without giving up the single fixed
preview that anchors visual memory of the library.
- Cycling activates only after a 1.5s dwell so ordinary hover actions
(action icons, tooltips) keep working; the card chrome fades out for
an unobstructed view while cycling and returns on mouse leave
- Example metadata and the first frame start preloading at hover time,
and each shown frame warms the next, so mode entry and interval ticks
never wait on the network
- The cover image (usually the preview itself) opens the rotation as
the anchor's stand-in; cycling starts from the second example and the
cover rejoins when the rotation wraps
- Video previews keep their autoplay-on-hover behavior; video entries
inside example lists are skipped, as are NSFW entries under SFW mode
and blurred cards until unblurred
- Honors prefers-reduced-motion, pauses in hidden tabs, and cleans up
when the virtual scroller recycles a card
- New settings: card_preview_cycle (default on) and
card_preview_cycle_interval (2/3/5/8s, default 3s)
Implements #1182
In legacy canvas rendering the search box and the LoRAs list sat flush on a
fresh node, and their gap grew while the node was resized. The canvas branch
of applyAutocompleteTextLayoutFix tried to clear the custom sizing with
`delete`, but computeLayoutSize() lives on DOMWidgetImpl.prototype, so the
delete was a no-op. The text widget stayed growable (60-100px) and shared the
node's free space with the LoRAs widget, while its 60px min-height overflowed
the DOM widget's 10px bottom margin: the visible gap was
min(20, allocation - 60).
Shadow computeLayoutSize with an own undefined property and give the widget a
fixed computeSize. Adjacent ComfyUI DOM widgets normally keep a 2 * margin
(20px) gap, which is too wide for the search box + LoRA list pair, so
allocate elementHeight + 8px instead: the search box stays 60px and the gap
stays constant at any node height, matching Vue node mode.
Also document the overlay margin math and the prototype-shadowing constraint
in the dual-mode widget guide.
The "already added" cue was a single check, so a listed-but-disabled
LoRA looked identical to an enabled one, and picking either inserted a
duplicate tag that left the disabled entry off.
Show two states — a green "Added" pill and an amber "Off" pill — and
make the pick act on them: an added LoRA is enabled in place (reusing
the shared add-or-enable helper), an active one is left alone, and the
typed query is removed either way so no duplicate tag or stray search
text is left in the prompt.
Co-authored-by: smhc <6404304+smhc@users.noreply.github.com>
Node rows can show library titles (Settings > LoRA Manager > Node LoRA
Name Display), but the textarea autocomplete only ever searched file
names. In "Model Name" mode a title fragment that does not appear in the
file name therefore returned nothing, even though the LoRA was visible
on the node.
Title matching follows the existing label setting instead of adding a
new toggle: File Name mode (the default) sends the unchanged request and
gets the same results and ordering as before. Only Model Name mode asks
the endpoint for title matches, which are appended after every filename
match so a path search is never reordered or hidden. The dropdown then
shows the title as the primary row label with the file name as secondary
text, matching what the node rows display.
Also cue results that are already on the node. The set is read from the
node's LoRA list (falling back to the textarea tags), normalized like the
backend resolves names, so legacy bare-name entries are recognized too.
Co-authored-by: smhc <6404304+smhc@users.noreply.github.com>
"Send to ComfyUI" appended a tag for a LoRA the node already listed,
which left a disabled entry disabled and made the button look broken.
Route the append path through shared add-or-enable helpers: listed LoRAs
are switched on in place (strengths kept), unlisted ones still append.
Reused from willmiao/ComfyUI-Lora-Manager#1181.
Co-authored-by: smhc <6404304+smhc@users.noreply.github.com>
CivitAI Workflow archives can bundle only a PNG/WebP screenshot whose
metadata carries the graph, with no workflow JSON member. Zip candidate
discovery now falls back to image members (bounded reads, full-size
images first) and parses their metadata in memory, while the archive
keeps its original bytes and SHA256 identity for CivitAI matching.
The LoRAs page search ran difflib.SequenceMatcher over every token of every
cached entry. Matching entries exit at the substring check, so the cost was
paid entirely by the entries that do not match - exactly the state the list is
in while a word is still being typed. At 100k entries one non-matching query
took 1.7-3.2s, and the handler runs that work on the event loop.
Gate the matcher with two exact necessary conditions instead of a heuristic:
2*min(len_a,len_b)/(len_a+len_b) is an upper bound on the ratio, and so is
twice the character-multiset intersection (a matching block can only use
characters present in both strings). Pairs that fail either bound provably
cannot reach the threshold, so every result is unchanged.
A non-matching query now takes 0.28-0.36s at 100k entries (6-9x faster) and
54-72ms at 20k (was 0.32-0.62s). Add a Hypothesis equivalence test against the
previous implementation, a regression test proving obvious misses never reach
the matcher, and a library-scale benchmark.
Fixes#1179
TestRecipeFTSIndexPerformance asserts a 100ms bound on a ~1ms search. On shared CI runners that flakes: the same test measured 0.12s and 0.14s on two consecutive main pushes while the code around it did not change.
Mark the class with the existing performance marker (pytest.ini already runs with -m "not performance"), matching tests/performance/. Run them explicitly with pytest -m performance.
View all local versions answers "every local version of this model", but the
listing request still carried the active folder: versions moved to another
folder silently disappeared, and a group-by-model card's version count (counted
across the library) no longer matched the list it opened.
- suspend the folder filter when the view starts, remember it, and show the root
selection so the sidebar and the grid agree
- restore the folder when the filter is cleared; keep it suspended across a
page reload
- picking a folder while the filter is active now exits it instead of being
silently ignored (the view is library-wide)
- hand a suspended folder back to its own page when another model page clears
the stale filter
- backend contract unchanged: the client simply omits `folder` while the view
is active
Tests cover the query params, folder suspend/restore/foreign handoff and the
sidebar folder handoff.
The Windows job has been red since the workflow auto-organize feature (#1177) landed: two assertions expected one separator form while the code produced another on Windows.
- download_manager joined the posix relative path ("SDXL 1.0/utility") onto a native root, so save_dir came out mixed-separated. Normalize the joined directory with normpath.
- auto-organize's flat-template branch returned the native root while the templated branch returned a posix path; ModelMoveService.move_model had the same split. Normalize both to the posix form the scanner stores.
Linux-only runs cannot catch either because os.sep == "/".
Workflows are graph documents (.json/.zip/.png/.webp), so quantization has
no meaning for them, yet WorkflowScanner inherited the base scanner's
unconditional quantization pass: every workflow row was resolved to ''
("checked, none"), a meaningless "quantization": null landed in the
sidecar, and the one-time backfill logged "Quantization backfill: updated
10/10 models for workflow".
- Add ModelScanner.supports_quantization (default True); WorkflowScanner
overrides it to False.
- Gate the one-time backfill scheduling and the scan-time resolution on
that flag, and make QuantizationBackfillService a no-op for scanners
that do not support quantization.
- Cover both paths: the service leaves workflow rows in their "not
checked" (NULL) state, and _load_persisted_cache still schedules only
the autov3 pass.
Fill in the 9 settings.directoryPicker.* creation keys in all 9 locales,
reusing the sidebar's existing folder vocabulary so the two folder-creation
surfaces stay consistent:
- newFolder matches sidebar.createFolder, nameInvalid matches
sidebar.dragDrop.invalidFolderName, createError is
sidebar.createFolderResult.failed without its {message} suffix, and
alreadyExists drops the "here" of sidebar.renameFolderResult.targetExists.
- German keeps the formal register, Spanish the tú form.
- Document the renderings in the i18n guidelines (§2) and record the feature
in the status block.
No [TODO: Translate] placeholder remains in any locale.
The settings folder picker could only select existing directories, so
creating a model root meant leaving the UI to create the folder first.
- Add POST /api/lm/create-directory, backed by create_directory() in
py/utils/directory_browser.py: it creates one subfolder of the browsed
directory and rejects names that are not a single safe path segment
(separators, dot names, Windows-invalid characters and reserved names,
over-long names) plus duplicates, missing/non-directory parents and
permission errors, each with a stable error_code.
- Add a New Folder button and an inline name row to the picker; the
created folder is entered immediately so it can be selected with one
click. Esc dismisses the row before closing the modal, and the button
is disabled on the Windows drive-list level where there is no
directory to create in.
- Map the server error codes to localized picker messages.
- Cover the endpoint and the picker flow with backend and frontend tests.
Users see a trigger word in someone else's prompt and have no way to tell
whether the LoRA is already in their library, so they fall back to searching
the model sites again.
- Read trigger words from civitai.trainedWords through a small helper that
tolerates the shapes older sidecars contain (None, a bare string, mixed
lists). Provenance does not matter: CivitAI/CivArchive sync, HuggingFace
or ModelScope model cards, the AI enrichment skill and manual edits all
write the same field.
- Add an opt-in trigger_words search option to SearchStrategy, evaluated
last before the always-on hash fallback. Matching is case-insensitive
substring only: fuzzy would run the sequence matcher over every declared
word of every entry and cost seconds on large libraries.
- Expose it as a "Trigger Words" chip on the LoRAs page only, plumb the
option through page state and the list request, and parse the new
search_trigger_words query param.
- Cover the strategy (including AI-enriched HuggingFace entries and
malformed trainedWords), the param parsing, the chip-to-state wiring and
the request query string. The English key is synced with a
[TODO: Translate] placeholder in the other locales.
Expose Auto-Organize on the Workflows page and give workflows their own
download path template, which both downloads and Auto-Organize use.
- Add a `workflow` default ({base_model}) to the backend and frontend path
template constants. Local workflows rarely carry CivitAI tags, so the
default stops at the base model instead of adding a "no tags" segment.
- Enable the bulk Auto-Organize action for workflows; the shared endpoint
and scanner move already handled them, only the UI gate was missing.
- Add the workflow row to Settings > Organization, rendered hidden and
toggled by the existing Workflow management master switch so the config
only appears while the feature is enabled.
- Preview workflow templates with a .json artifact name instead of a
weight-file name.
- Cover the default template, download routing, both auto-organize modes,
sidecar moves, and the settings gate with tests.