Skip to content

Commit 1de3f58

Browse files
committed
fix(image): automatic image with aspect ratio
1 parent 980bbed commit 1de3f58

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/image/application/usecases/AutomaticRequestImage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class AutomaticRequestImage {
2424
const response = await this.promptGateway.generatePrompt(promptToUse)
2525
let config = { size: 1, sampler: 'none', scheduler: 'none', steps: 0 }
2626
if (gateway === 'automatic1111') config = { size: 1, sampler: 'DPM++ 2M', scheduler: 'Karras', steps: 20 }
27-
const batchConfiguration = Batch.getConfigurations(gateway, { ...response, ...config })
27+
const batchConfiguration = Batch.configurationFactory({ ...response, ...config, gateway })
2828
const batch = Batch.create({
2929
prompt: response.prompt,
3030
automatic: true,
@@ -35,7 +35,7 @@ export class AutomaticRequestImage {
3535
repositoryBatch.register('imageRequested', async (domainEvent: DomainEvent) => {
3636
await this.queue.publish(domainEvent.eventName, domainEvent.data)
3737
})
38-
await repositoryBatch.requestImage({ gateway, isAutomatic: true, dimensions: { width: response.width, height: response.height } })
38+
await repositoryBatch.requestImage({ gateway, isAutomatic: true, aspectRatio: response.aspectRatio })
3939
}
4040
}
4141
}

src/prompt/domain/gateways/dtos/PromptGateway.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export interface PromptOutput {
33
prompt: string
44
width: number
55
height: number
6+
aspectRatio: string
67
}

0 commit comments

Comments
 (0)