Keep the image batch popup open, and add a lock on each dial.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+25
-7
@@ -362,12 +362,11 @@
|
||||
<button
|
||||
v-if="imagePassMode === 'batch'"
|
||||
type="button"
|
||||
class="w-full rounded-2xl border border-dashed px-4 py-2.5 text-left text-sm transition"
|
||||
class="w-full scroll-mt-24 rounded-2xl border border-dashed px-4 py-2.5 text-left text-sm transition"
|
||||
:class="imageBatchScript.trim()
|
||||
? 'border-amber-300/40 bg-amber-400/5 text-amber-100 hover:border-amber-300'
|
||||
: 'border-white/15 text-zinc-300 hover:border-amber-300/40 hover:text-amber-100'"
|
||||
:disabled="editBusy"
|
||||
@click="openImageBatchModal"
|
||||
@click.stop.prevent="openImageBatchModal"
|
||||
>
|
||||
<span class="block font-semibold">{{ imageBatchScript.trim() ? 'Edit batch script' : 'Paste batch script' }}</span>
|
||||
<span class="text-[11px] leading-snug text-zinc-400">{{ imageBatchButtonHint }}</span>
|
||||
@@ -796,6 +795,7 @@
|
||||
<span class="mb-1 block text-zinc-300">Strength (denoise)</span>
|
||||
<Thumbwheel
|
||||
v-model="v2Denoise"
|
||||
lock-key="v2-denoise"
|
||||
:min="IMAGE_V2_DENOISE_MIN"
|
||||
:max="IMAGE_V2_DENOISE_MAX"
|
||||
:step="IMAGE_V2_DENOISE_STEP"
|
||||
@@ -857,6 +857,7 @@
|
||||
<Thumbwheel
|
||||
v-model="v2Megapixels"
|
||||
aria-label="Megapixels"
|
||||
lock-key="megapixels"
|
||||
:min="IMAGE_SCALE_MP_MIN"
|
||||
:max="IMAGE_SCALE_MP_MAX"
|
||||
:step="IMAGE_SCALE_MP_STEP"
|
||||
@@ -5879,23 +5880,38 @@ function reconstructImageBatchScript() {
|
||||
|
||||
function openImageBatchModal() {
|
||||
imageBatchDraft.value = reconstructImageBatchScript()
|
||||
imageBatchOpen.value = true
|
||||
requestAnimationFrame(() => {
|
||||
imageBatchOpen.value = true
|
||||
})
|
||||
}
|
||||
|
||||
function applyImageBatch() {
|
||||
const shots = parseImageBatchScript(imageBatchDraft.value)
|
||||
function applyImageBatch(text?: string) {
|
||||
const src = String(text ?? imageBatchDraft.value)
|
||||
const shots = parseImageBatchScript(src)
|
||||
if (!shots.length) {
|
||||
toast('Paste at least one prompt. Put shot 1, shot 2 on their own lines.')
|
||||
return
|
||||
}
|
||||
imagePassMode.value = 'batch'
|
||||
imageBatchScript.value = imageBatchDraft.value
|
||||
imageBatchDraft.value = src
|
||||
imageBatchScript.value = src
|
||||
prompt.value = shots[0].prompt
|
||||
editPassQueue.value = shots.slice(1).map(item => ({ id: crypto.randomUUID(), prompt: item.prompt }))
|
||||
imageBatchOpen.value = false
|
||||
toast(shots.length === 1 ? 'Loaded 1 prompt' : `Loaded ${shots.length} prompts on the start still`)
|
||||
}
|
||||
|
||||
function absorbPastedImageBatch() {
|
||||
if (imagePassMode.value !== 'batch') return
|
||||
if (!(studioMode.value === 'edit' || v2PassChaining.value)) return
|
||||
if (editPassQueue.value.length) return
|
||||
const shots = parseImageBatchScript(prompt.value)
|
||||
if (shots.length < 2) return
|
||||
imageBatchScript.value = prompt.value
|
||||
prompt.value = shots[0].prompt
|
||||
editPassQueue.value = shots.slice(1).map(item => ({ id: crypto.randomUUID(), prompt: item.prompt }))
|
||||
}
|
||||
|
||||
function imagePassUnit() {
|
||||
return imagePassMode.value === 'batch' ? 'Batch' : 'Pass'
|
||||
}
|
||||
@@ -5922,6 +5938,7 @@ async function editImage() {
|
||||
toast('Choose a library folder before editing.')
|
||||
return
|
||||
}
|
||||
absorbPastedImageBatch()
|
||||
const extraPasses = editPassQueue.value.map(item => ({ prompt: item.prompt.trim() }))
|
||||
const hideOut = hideThumbnail.value
|
||||
try {
|
||||
@@ -6137,6 +6154,7 @@ async function editImageV2() {
|
||||
toast('Each extra pass needs a prompt.')
|
||||
return
|
||||
}
|
||||
absorbPastedImageBatch()
|
||||
const extraPasses = v2PassChaining.value ? editPassQueue.value.map(item => ({ prompt: item.prompt.trim() })) : []
|
||||
const hideOut = hideThumbnail.value
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user