Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (claude): give the sweet-spot max one source of truth

[._.]/ Adam Eivy9954c0cc4af2
diff --git a/client/src/components/loraTraining/GenerateBatchDialog.jsx b/client/src/components/loraTraining/GenerateBatchDialog.jsx
index cd364c677e..99e08ee9e1 100644
--- a/client/src/components/loraTraining/GenerateBatchDialog.jsx
+++ b/client/src/components/loraTraining/GenerateBatchDialog.jsx
@@ -10,6 +10,15 @@ import toast from '../ui/Toast';
import Modal from '../ui/Modal';
import { generateLoraDatasetImages } from '../../services/api';
+// Advisory dataset-quality targets, mirrored from server/lib/loraDataset.js
+// (RECOMMENDED_TRAINING_IMAGES / TRAINING_IMAGE_SWEET_SPOT_MAX). Kept local
+// so the batch default + sweet-spot copy share one source of truth with the
+// readiness coaching on LoraDatasetDetail. MAX_BATCH_IMAGES is this dialog's
+// own slider cap (matches server buildVariationMatrix's 40-tuple clamp).
+const RECOMMENDED_TRAINING_IMAGES = 20;
+const TRAINING_IMAGE_SWEET_SPOT_MAX = 30;
+const MAX_BATCH_IMAGES = 40;
+
const ChipToggleList = ({ idPrefix, label, options, selected, onToggle }) => (
<div>
<span className="block text-sm text-gray-400 mb-1">{label}</span>
@@ -34,10 +43,10 @@ const ChipToggleList = ({ idPrefix, label, options, selected, onToggle }) => (
);
export default function GenerateBatchDialog({ dataset, expressionOptions = [], outfitOptions = [], onClose, onStarted }) {
- // Default to the recommended quality target (~20) rather than the bare
- // minimum so a one-click batch lands a strong dataset. See the tips block
- // in LoraDatasetDetail for the rationale (variety > volume; ~20–30 sweet spot).
- const [count, setCount] = useState(20);
+ // Default to the recommended quality target rather than the bare minimum so
+ // a one-click batch lands a strong dataset. See the tips block in
+ // LoraDatasetDetail for the rationale (variety > volume; sweet spot range).
+ const [count, setCount] = useState(RECOMMENDED_TRAINING_IMAGES);
const [expressions, setExpressions] = useState(expressionOptions);
const [outfits, setOutfits] = useState(outfitOptions);
const [submitting, setSubmitting] = useState(false);
@@ -82,13 +91,14 @@ export default function GenerateBatchDialog({ dataset, expressionOptions = [], o
id="lt-gen-count"
type="range"
min={1}
- max={40}
+ max={MAX_BATCH_IMAGES}
value={count}
onChange={(e) => setCount(Number(e.target.value))}
className="w-full"
/>
<p className="text-xs text-gray-500 mt-1">
- Sweet spot ~20–30. Fewer than 10 won&apos;t train; past ~40 mostly adds time and overfitting risk.
+ Sweet spot ~{RECOMMENDED_TRAINING_IMAGES}–{TRAINING_IMAGE_SWEET_SPOT_MAX}. Fewer than 10 won&apos;t train;
+ past ~{MAX_BATCH_IMAGES} mostly adds time and overfitting risk.
</p>
</div>
{expressionOptions.length > 0 && (
diff --git a/client/src/pages/LoraDatasetDetail.jsx b/client/src/pages/LoraDatasetDetail.jsx
index f97779ee1e..0d72b4561f 100644
--- a/client/src/pages/LoraDatasetDetail.jsx
+++ b/client/src/pages/LoraDatasetDetail.jsx
@@ -38,6 +38,7 @@ const TRIGGER_RE = /^[a-z0-9_]{2,64}$/;
// when the server helper changes.
const MIN_TRAINING_IMAGES = 10;
const RECOMMENDED_TRAINING_IMAGES = 20;
+const TRAINING_IMAGE_SWEET_SPOT_MAX = 30;
const qualityTier = (captioned) => {
if (captioned < MIN_TRAINING_IMAGES) return 'insufficient';
if (captioned < RECOMMENDED_TRAINING_IMAGES) return 'minimum';
@@ -417,12 +418,12 @@ export default function LoraDatasetDetail() {
<Lightbulb className="w-4 h-4 text-port-warning shrink-0" />
<span className="font-medium">Tips for a strong character dataset</span>
<span className="text-xs text-gray-500">
- target ~{RECOMMENDED_TRAINING_IMAGES}–30 images · {MIN_TRAINING_IMAGES} minimum
+ target ~{RECOMMENDED_TRAINING_IMAGES}–{TRAINING_IMAGE_SWEET_SPOT_MAX} images · {MIN_TRAINING_IMAGES} minimum
</span>
</summary>
<div className="px-3 pb-3 pt-1 text-xs text-gray-400 space-y-2 border-t border-port-border/60">
<p>
- Quality beats quantity. {MIN_TRAINING_IMAGES} images is the floor; ~{RECOMMENDED_TRAINING_IMAGES}–30 sharp,
+ Quality beats quantity. {MIN_TRAINING_IMAGES} images is the floor; ~{RECOMMENDED_TRAINING_IMAGES}–{TRAINING_IMAGE_SWEET_SPOT_MAX} sharp,
varied shots is the sweet spot. Past ~50 you mostly add training time and overfitting risk —
near-duplicate frames teach the model to memorize a pose instead of learning the character.
</p>