Skip to content

Studio: pick which LoRA to add from a searchable list instead of cycling through them - #16964

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
oobabooga:studio-lora-picker
Nov 7, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
oobabooga:studio-lora-picker

Conversation

@oobabooga

@oobabooga oobabooga commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Closes #16900.

Problem

On the Images page, "Add LoRA" appended the next unused LoRA instead of asking which one. With 9 LoRAs installed, getting the 5th took 5 clicks and 4 row deletions, and the 9th could not be added at all because the button hides at 8 rows.

The auto-fill made sense when each row was a dropdown, since you changed the LoRA in place. #6789 turned rows into free-text fields with a <datalist>, which only suggests entries matching the current text, so a pre-filled row no longer shows the alternatives.

Fix

"Add LoRA" now opens a searchable list, using the Popover and Command components the Settings language selector uses. LoRAs are grouped as fine-tuned in Unsloth, on this device, and from Hugging Face, and picking one adds it as a row. Beyond what the screenshots show:

  • A LoRA already in a row is marked "Added" and can't be picked again. This covers typed Hugging Face ids too, since the backend rejects a repeated id.
  • Pasting an owner/name or owner/name:file that isn't listed offers Use <id>. "Enter a Hugging Face repo or file…" adds an empty row with the cursor in it.
  • In a short window only the list shrinks, so the search box and the Hugging Face entry stay visible.
  • With no LoRAs listed, the button still adds an empty row directly.

Rows still accept free text. The 8-row limit, default weights and request payload are unchanged, and there are no backend changes.

Before and after

Main (992185ae8e) vs this PR (ab59e0e738), with 9 Z-Image-Turbo LoRAs installed:

lora_picker_01_add_lora_on_the_page

lora_picker_02_step_by_step

Verification

Live in Studio with Z-Image-Turbo loaded, driven with Playwright:

  • Picking by mouse and keyboard: Enter opens the list with focus in the search box, arrows and Enter add an entry, Escape adds nothing, and focus returns to the button. Also checked: duplicate blocking for listed and typed ids, the 8-row limit, focus in the empty row, and the Hugging Face entry at 1000×600 and 1000×500.
  • Generated with a LoRA from the list, a pasted Hugging Face id, and an owner/name:file id downloaded on first use. Each request carried the id, and the backend logged the LoRA as applied.
  • The new tests/image-lora-add-options.test.ts (5 tests) and node scripts/typecheck.mjs --tests pass, and ESLint reports no new findings. The full frontend suite has 7 failures, all in memory and context-window tests that don't import these files.

Before and after: merge base vs head, independent check

Two Studio installs, merge base 992185ae8 (left) and head 6e68b3136 (right), same 9-LoRA catalog for Z-Image-Turbo on both sides.

One click on Add LoRA. Before: a sks-dog row is appended. After: the grouped, searchable list opens and nothing is added yet.

pr16964_lora_picker_00

Getting to pixel_art. Before: a second click appends jyzjk. After: typing pixel narrows the list to that entry.

pr16964_lora_picker_01

Target reached. Before: 4 clicks and 3 rows to delete. After: one row, pixel_art.

pr16964_lora_picker_02

The same flows (keyboard open and search, Enter to add, focus back on the button, duplicates disabled, a pasted owner/name:file id, the empty row taking focus, the Hugging Face entry visible at 1000x500) give identical results in Chromium, Firefox and WebKit. WebKit at 1000x500:

pr16964_lora_picker_webkit_short

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T20:33:03.020694Z 6e68b31 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 6e68b31362

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen danielhanchen self-assigned this Nov 7, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 7, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 7, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 7, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 7, 2026
@danielhanchen
danielhanchen merged commit 671a16c into unslothai:main Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Allow selecting a specific LoRA when clicking "Add LoRA"

2 participants