Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

ui: Enhance and LoRA as compact icons in the composer row

Gabriele Lozuponef38c1f259474
diff --git a/src/components/Composer.tsx b/src/components/Composer.tsx
index fd1b96f..bfd3fd5 100644
--- a/src/components/Composer.tsx
+++ b/src/components/Composer.tsx
@@ -293,31 +293,29 @@ function LoraBadge() {
const on = activeLoras({ loras: choice }, all);
const names = all.filter((l) => on.includes(l.id)).map((l) => `${l.name} (${weightLabel(l.weight)})`);
const title = on.length ? `LoRA on in this project: ${names.join(", ")}` : "LoRA: none on in this project";
- const label = on.length === 1 ? all.find((l) => l.id === on[0])?.name ?? "LoRA" : on.length > 1 ? `LoRA · ${on.length}` : "LoRA";
const toggle = (id: string) => setProjectLoras(toggleLora({ loras: choice }, all, id));
if (all.length === 1) {
const l = all[0];
return (
<button
- className={`pill lora ${on.length ? "on" : ""}`}
+ className={`icon-btn ${on.length ? "active" : ""}`}
role="switch"
aria-checked={on.length > 0}
+ aria-label={`LoRA ${l.name}`}
disabled={!l.available}
onClick={() => toggle(l.id)}
title={l.available ? `${title}. Click to turn ${on.length ? "off" : "on"}.` : "This LoRA's file is missing: load it again in Settings → LoRA."}
>
- <Layers size={15} />
- <span className="lora-name">{label}</span>
+ <Layers size={17} />
</button>
);
}
return (
<Popover
trigger={(open, toggleOpen) => (
- <button className={`pill lora ${on.length || open ? "on" : ""}`} onClick={toggleOpen} title={title}>
- <Layers size={15} />
- <span className="lora-name">{label}</span>
- <ChevronDown size={13} />
+ <button className={`icon-btn has-badge ${on.length || open ? "active" : ""}`} onClick={toggleOpen} title={title} aria-label={`LoRA, ${on.length} on`}>
+ <Layers size={17} />
+ {on.length > 0 && <span className="lora-count">{on.length}</span>}
</button>
)}
>
@@ -497,6 +495,23 @@ export function Composer() {
}
</Popover>
+ {canEnhance && (
+ <button
+ className={`icon-btn ${c.enhance ? "active" : ""}`}
+ role="switch"
+ aria-checked={c.enhance}
+ aria-label="Prompt enhancer"
+ onClick={() => updateComposer({ enhance: !c.enhance })}
+ title={
+ c.enhance
+ ? "Prompt enhancer on: before making the image, the model rewrites your prompt as a detailed English description (looking at your image for edits). You see it being written; the result keeps both. Click to turn off."
+ : "Prompt enhancer: let the model rewrite a short prompt, in any language, as a detailed English description before making the image. Adds a few seconds."
+ }
+ >
+ <WandSparkles size={17} />
+ </button>
+ )}
+
<Popover
placement="top-start"
className="panel"
@@ -515,29 +530,13 @@ export function Composer() {
{() => <AdvancedPanel plan={plan} />}
</Popover>
- {canEnhance && (
- <button
- className={`pill enhance ${c.enhance ? "on" : ""}`}
- role="switch"
- aria-checked={c.enhance}
- onClick={() => updateComposer({ enhance: !c.enhance })}
- title={
- c.enhance
- ? "Prompt enhancer on: before making the image, the model rewrites your prompt as a detailed English description (looking at your image for edits). You see it being written; the result keeps both. Click to turn off."
- : "Prompt enhancer: let the model rewrite a short prompt, in any language, as a detailed English description before making the image. Adds a few seconds."
- }
- >
- <WandSparkles size={15} />
- Enhance
- </button>
- )}
-
- <LoraBadge />
<button className="icon-btn" onClick={() => setState({ overlay: "prompt-tips" })} title="Prompt tips" aria-label="Prompt tips">
<Lightbulb size={17} />
</button>
+ <LoraBadge />
+
<span className="spacer" />
<span className="plan-hint" title={hintTitle}>
{hint}
diff --git a/src/styles.css b/src/styles.css
index ba08c50..f366c03 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -193,8 +193,7 @@ svg { display: block; flex: none; }
.shimmer { color: var(--text-3); background: none; }
}
.stage-meta .enhanced-mark { flex: none; display: inline-flex; color: var(--text-2); }
-.pill.enhance.on { background: var(--surface-2); }
-.pill.lora.on { background: var(--surface-2); }
+.lora-count { position: absolute; top: 2px; right: 1px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--text); color: var(--bg); font-size: 10px; font-weight: 600; line-height: 14px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.lora-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover .opt:disabled { opacity: 0.5; cursor: default; }
.failed { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 460px; text-align: center; color: var(--text-2); }