Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-19 21:10:38 +00:00
parent 0a9a83aec3
commit 55767c0141
+19
View File
@@ -379,6 +379,25 @@ export const useModelStore = create<ModelStore>((set, get) => ({
scaleRatio: SCALE_PRESETS.find(p => p.label === '1:1')!, scaleRatio: SCALE_PRESETS.find(p => p.label === '1:1')!,
setScaleRatio: (scaleRatio) => set({ scaleRatio }), setScaleRatio: (scaleRatio) => set({ scaleRatio }),
scaleResetNonce: 0,
resetScale: () => set((state) => {
const oneToOne = SCALE_PRESETS.find(p => p.label === '1:1')!;
const activeId = state.activeModelId;
const models = activeId
? state.models.map(m => m.id === activeId
? { ...m, fineTuning: { ...m.fineTuning, scale: 1 } }
: m)
: state.models;
const active = models.find(m => m.id === activeId);
const fineTuning = active ? { ...active.fineTuning } : { ...state.fineTuning, scale: 1 };
if (active) savePlacement(active.fileName, fineTuning);
return {
scaleRatio: oneToOne,
models,
fineTuning,
scaleResetNonce: state.scaleResetNonce + 1,
};
}),
opacity: 1, opacity: 1,
setOpacity: (opacity) => set({ opacity }), setOpacity: (opacity) => set({ opacity }),