+ Paste a block. Put
+ shot 1,
+ shot 2
+ on their own lines —
+ image 1
+ works the same. Each one is a new prompt on the start still, not the last output.
+
+
+
+
+
+
+
+
+
+
+ {{ parsed.length }} image{{ parsed.length === 1 ? '' : 's' }} from the start still
+ Images appear here once the first prompt is in.
+
+
+
+
+ Image {{ index + 1 }}
+ · shot {{ shot.n }}
+
+
{{ shot.prompt }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/index.vue b/pages/index.vue
index b9c2484..3046f81 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -359,6 +359,19 @@
Each pass from the last output
+
+
import { parseEditPasses, looksLikeShotScript } from '~/utils/parseRecommend'
-import { parseShotScript } from '~/utils/parseShots'
+import { parseImageBatchScript, parseShotScript } from '~/utils/parseShots'
import type { DirectorScript } from '~/utils/directorScripts'
import {
composeShotPrompt,
@@ -2259,10 +2278,14 @@ const recommendJobId = ref('')
const recommendApplied = ref(false)
const promptBeforeRecommend = ref('')
const editPassesBeforeRecommend = ref([])
+const imageBatchBeforeRecommend = ref('')
const shotScriptBeforeRecommend = ref(false)
const extensionQueue = ref([])
const editPassQueue = ref([])
const imagePassMode = ref('batch')
+const imageBatchOpen = ref(false)
+const imageBatchScript = ref('')
+const imageBatchDraft = ref('')
const clipName = ref('')
const videoDownloadName = ref('output')
const editDownloadName = ref('edited')
@@ -2832,9 +2855,14 @@ const extraPassButtonLabel = computed(() => {
if (imagePassMode.value === 'batch') return '+ Prompt'
return studioMode.value === 'editv2' && v2Mode.value === 'compose' ? '+ Compose pass' : '+ Edit pass'
})
+const imageBatchButtonHint = computed(() => {
+ const n = 1 + editPassQueue.value.length
+ if (imageBatchScript.value.trim() && n > 1) return `${n} prompts on the start still. Same format as a video shot list.`
+ return 'Paste shot 1, shot 2, shot 3. Each image is a new prompt on the original still.'
+})
const extraPassHint = computed(() => {
if (imagePassMode.value === 'batch') {
- return 'Every prompt runs from the start still. Outputs do not feed the next prompt.'
+ return 'Every prompt runs from the start still. Paste a shot list, or add prompts one at a time. Outputs do not feed the next prompt.'
}
if (studioMode.value === 'editv2' && v2Mode.value === 'compose') {
return 'Each extra pass is another Compose on the last output, with the same still B. You cannot switch graphs between passes.'
@@ -3992,7 +4020,7 @@ function applyGenerationPreset(preset: GenerationPreset) {
const settings = preset.settings as ImageV2PresetSettings
persistImageV2LoraStack(imageV2LoraStack.value, v2Engine.value)
v2Mode.value = settings.mode === 'compose' ? 'compose' : settings.mode === 'refine' ? 'refine' : settings.mode === 'generate' ? 'generate' : 'edit'
- if (v2Mode.value !== 'edit' && v2Mode.value !== 'compose') editPassQueue.value = []
+ if (v2Mode.value !== 'edit' && v2Mode.value !== 'compose') clearEditPasses()
v2Engine.value = parseImageV2Engine(settings.engine, 'flux')
v2Task.value = v2Mode.value === 'compose' ? (settings.task || 'scene') : v2Mode.value === 'refine' ? 'refine' : v2Mode.value === 'generate' ? 't2i' : 'scene'
if (typeof settings.prompt === 'string') prompt.value = settings.prompt
@@ -4267,12 +4295,21 @@ function applyRecommend() {
if (!text) return
promptBeforeRecommend.value = prompt.value
editPassesBeforeRecommend.value = editPassQueue.value.map(item => ({ ...item }))
+ imageBatchBeforeRecommend.value = imageBatchScript.value
shotScriptBeforeRecommend.value = shotScriptMode.value
if (studioMode.value === 'edit' || v2PassChaining.value) {
- const passes = parseEditPasses(text)
- if (passes && passes.length > 1) {
- prompt.value = passes[0]
- editPassQueue.value = passes.slice(1).map(item => ({ id: crypto.randomUUID(), prompt: item }))
+ const fromPasses = parseEditPasses(text)
+ const fromScript = parseImageBatchScript(text)
+ const parts = fromPasses && fromPasses.length > 1
+ ? fromPasses
+ : fromScript.length > 1
+ ? fromScript.map(item => item.prompt)
+ : null
+ if (parts && parts.length > 1) {
+ prompt.value = parts[0]
+ editPassQueue.value = parts.slice(1).map(item => ({ id: crypto.randomUUID(), prompt: item }))
+ imagePassMode.value = 'batch'
+ imageBatchScript.value = fromPasses ? '' : text
} else {
prompt.value = text
}
@@ -4289,6 +4326,7 @@ function applyRecommend() {
function revertRecommend() {
prompt.value = promptBeforeRecommend.value
editPassQueue.value = editPassesBeforeRecommend.value.map(item => ({ ...item }))
+ imageBatchScript.value = imageBatchBeforeRecommend.value
shotScriptMode.value = shotScriptBeforeRecommend.value
recommendApplied.value = false
}
@@ -5825,6 +5863,39 @@ function removeEditPass(id: string) {
editPassQueue.value = editPassQueue.value.filter(item => item.id !== id)
}
+function clearEditPasses() {
+ editPassQueue.value = []
+ imageBatchScript.value = ''
+}
+
+function reconstructImageBatchScript() {
+ if (imageBatchScript.value.trim()) return imageBatchScript.value
+ const first = prompt.value.trim()
+ const rest = editPassQueue.value.map(item => item.prompt.trim()).filter(Boolean)
+ if (!first && !rest.length) return ''
+ if (!rest.length) return first
+ return [`shot 1\n${first}`, ...rest.map((item, index) => `shot ${index + 2}\n${item}`)].join('\n\n')
+}
+
+function openImageBatchModal() {
+ imageBatchDraft.value = reconstructImageBatchScript()
+ imageBatchOpen.value = true
+}
+
+function applyImageBatch() {
+ const shots = parseImageBatchScript(imageBatchDraft.value)
+ 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
+ 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 imagePassUnit() {
return imagePassMode.value === 'batch' ? 'Batch' : 'Pass'
}
@@ -6023,7 +6094,7 @@ async function ensureRefineCanvas() {
async function sendToEdit() {
if (!editResultUrl.value) return
- editPassQueue.value = []
+ clearEditPasses()
studioMode.value = 'editv2'
outputFocus.value = 'edit'
try {
@@ -6037,7 +6108,7 @@ async function sendToEdit() {
async function sendToRefine() {
if (!editResultUrl.value) return
- editPassQueue.value = []
+ clearEditPasses()
studioMode.value = 'editv2'
outputFocus.value = 'edit'
try {
diff --git a/utils/parseShots.ts b/utils/parseShots.ts
index 7514833..63a74d1 100644
--- a/utils/parseShots.ts
+++ b/utils/parseShots.ts
@@ -4,9 +4,8 @@ export interface ParsedShot {
role: 'initial' | 'extension'
}
-export function parseShotScript(text: string): ParsedShot[] {
+function parseMarkedBlocks(text: string, marker: RegExp): ParsedShot[] {
const src = String(text || '').replace(/\r\n/g, '\n')
- const marker = /^[ \t]*shot\s+(\d+)\b/gim
const markers: { n: number; start: number; end: number }[] = []
for (const match of src.matchAll(marker)) {
markers.push({
@@ -41,3 +40,11 @@ export function parseShotScript(text: string): ParsedShot[] {
role: index === 0 ? 'initial' : 'extension'
}))
}
+
+export function parseShotScript(text: string): ParsedShot[] {
+ return parseMarkedBlocks(text, /^[ \t]*shot\s+(\d+)\b/gim)
+}
+
+export function parseImageBatchScript(text: string): ParsedShot[] {
+ return parseMarkedBlocks(text, /^[ \t]*(?:shot|image|prompt)\s+(\d+)\b/gim)
+}