Separate Studio 2 source and canvas and apply size and seed choices
This commit is contained in:
@@ -11,8 +11,9 @@ export function bindClip(form, clip) {
|
||||
if (!clip?.id) return form
|
||||
const saved = clip.studio2 || {}, settings = saved.settings || clip.settings || clip
|
||||
const next = {...form, startClipId:clip.id, settings:{...form.settings}}
|
||||
next.settings.aspect=['auto','16:9','9:16','1:1'].includes(settings.aspect)?settings.aspect:'auto'
|
||||
for (const key of ['duration','aspect','width','height','fps','loraStack','turbo','steps','cfg']) {
|
||||
if (settings[key] != null) next.settings[key] = structuredClone(settings[key])
|
||||
if (settings[key] != null && key!=='aspect') next.settings[key] = structuredClone(settings[key])
|
||||
}
|
||||
next.engine = saved.engine || clip.engine || 'minimax'
|
||||
if (saved.identityStillId) next.identityStillId = saved.identityStillId
|
||||
@@ -23,7 +24,12 @@ export function bindClip(form, clip) {
|
||||
export function restoreAsset(form, item) {
|
||||
const restored = restoreInput(item)
|
||||
const next = {...form,...restored,settings:{...form.settings,...restored.settings}}
|
||||
return item.kind === 'clip' || item.studio2?.kind === 'video' ? {...bindClip(next,item),mode:'extend'} : next
|
||||
next.settings.seedMode='random'
|
||||
if (item.kind === 'clip' || item.studio2?.kind === 'video') return {...bindClip(next,item),mode:'extend'}
|
||||
next.imageAId=item.id
|
||||
next.startClipId=''
|
||||
next.settings.aspect=item.studio2?.settings?.aspect || item.settings?.aspect || 'auto'
|
||||
return next
|
||||
}
|
||||
export function extendSelected(form, clip) {
|
||||
// Switching task on the already bound clip must preserve the user's overrides.
|
||||
|
||||
Reference in New Issue
Block a user