Fix prop confirmation bug, add Wan 2.7 model, refine multiple UI details, improve prop generation quality and aspect ratio, remove text overlays from Asset Center created images, and optimize prop filtering logic
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Job } from 'bullmq'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { LOCATION_IMAGE_RATIO, PROP_IMAGE_RATIO } from '@/lib/constants'
|
||||
import { TASK_TYPE, type TaskJobData } from '@/lib/task/types'
|
||||
|
||||
const utilsMock = vi.hoisted(() => ({
|
||||
@@ -118,7 +119,7 @@ describe('worker image-task-handlers-core', () => {
|
||||
expect.anything(),
|
||||
expect.objectContaining({
|
||||
options: expect.objectContaining({
|
||||
aspectRatio: '1:1',
|
||||
aspectRatio: LOCATION_IMAGE_RATIO,
|
||||
resolution: '1536x1024',
|
||||
referenceImages: ['required-reference-image', 'normalized-reference-image'],
|
||||
}),
|
||||
@@ -132,6 +133,34 @@ describe('worker image-task-handlers-core', () => {
|
||||
expect(updateData.imageUrl).toBe('cos/new-image.png')
|
||||
})
|
||||
|
||||
it('uses the character-matching aspect ratio when modifying project prop images', async () => {
|
||||
prismaMock.locationImage.findUnique.mockResolvedValueOnce({
|
||||
id: 'prop-image-1',
|
||||
locationId: 'prop-1',
|
||||
imageUrl: 'cos/prop-old.png',
|
||||
description: 'silver prop',
|
||||
previousDescription: null,
|
||||
location: { name: 'Silver Prop' },
|
||||
})
|
||||
|
||||
await handleModifyAssetImageTask(buildJob({
|
||||
type: 'prop',
|
||||
locationImageId: 'prop-image-1',
|
||||
modifyPrompt: 'make it brushed silver',
|
||||
generationOptions: { resolution: '1536x1024' },
|
||||
}))
|
||||
|
||||
expect(utilsMock.resolveImageSourceFromGeneration).toHaveBeenCalledWith(
|
||||
expect.anything(),
|
||||
expect.objectContaining({
|
||||
options: expect.objectContaining({
|
||||
aspectRatio: PROP_IMAGE_RATIO,
|
||||
resolution: '1536x1024',
|
||||
}),
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('updates storyboard panel image and keeps candidateImages reset', async () => {
|
||||
prismaMock.novelPromotionPanel.findUnique.mockResolvedValue({
|
||||
id: 'panel-1',
|
||||
|
||||
Reference in New Issue
Block a user