Flatten image edit controls and let CFG/steps be typed past the old slider caps.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-28 15:42:59 -05:00
co-authored by Cursor
parent f8db0d626a
commit a2f728fe2e
6 changed files with 151 additions and 100 deletions
+3 -14
View File
@@ -2,18 +2,7 @@ import { addStudioJob, kickStudioQueue, listStudioJobs } from '~/server/utils/st
import { parsePostedLoraStack, listStudioLoras, persistLoraFields } from '~/server/utils/loras'
import { comfyConfigured } from '~/server/utils/comfy'
import { imageDimensions } from '~/server/utils/resolution'
function parseSteps(raw: unknown) {
const value = Number(raw)
if (!Number.isFinite(value)) return 20
return Math.min(40, Math.max(1, Math.round(value)))
}
function parseCfg(raw: unknown) {
const value = Number(raw)
if (!Number.isFinite(value)) return 1
return Math.min(8, Math.max(0.5, Math.round(value * 10) / 10))
}
import { clampImageCfg, clampImageSteps } from '~/utils/generationPresets'
function parsePasses(raw: string | undefined) {
if (!raw) return [] as { prompt: string }[]
@@ -75,8 +64,8 @@ export default defineEventHandler(async (event) => {
const folderLocked = Boolean(destFolder?.protected && !destFolder.unlocked)
const hideInput = fields.hideInput === 'true'
const hideThumbnail = fields.hideThumbnail === 'true'
const steps = parseSteps(fields.steps)
const cfg = parseCfg(fields.cfg)
const steps = clampImageSteps(fields.steps)
const cfg = clampImageCfg(fields.cfg)
const seed = fields.seed && fields.seed !== 'random'
? Number(fields.seed)
: Math.floor(Math.random() * 2_147_483_647)