Skip to content

Commit

Permalink
use imageSettings from character file
Browse files Browse the repository at this point in the history
while still retaining the ability to call via options with js
  • Loading branch information
proteanx committed Dec 22, 2024
1 parent 9d862dd commit ba0b324
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions packages/plugin-image-generation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,15 @@ const imageGeneration: Action = {
const images = await generateImage(
{
prompt: imagePrompt,
width: options.width || 1024,
height: options.height || 1024,
...(options.count != null ? { count: options.count || 1 } : {}),
...(options.negativePrompt != null
? { negativePrompt: options.negativePrompt }
: {}),
...(options.numIterations != null
? { numIterations: options.numIterations }
: {}),
...(options.guidanceScale != null
? { guidanceScale: options.guidanceScale }
: {}),
...(options.seed != null ? { seed: options.seed } : {}),
...(options.modelId != null
? { modelId: options.modelId }
: {}),
...(options.jobId != null ? { jobId: options.jobId } : {}),
width: options.width || imageSettings.width || 1024,
height: options.height || imageSettings.height || 1024,
...(options.count != null || imageSettings.count != null ? { count: options.count || imageSettings.count || 1 } : {}),
...(options.negativePrompt != null || imageSettings.negativePrompt != null ? { negativePrompt: options.negativePrompt || imageSettings.negativePrompt } : {}),
...(options.numIterations != null || imageSettings.numIterations != null ? { numIterations: options.numIterations || imageSettings.numIterations } : {}),
...(options.guidanceScale != null || imageSettings.guidanceScale != null ? { guidanceScale: options.guidanceScale || imageSettings.guidanceScale } : {}),
...(options.seed != null || imageSettings.seed != null ? { seed: options.seed || imageSettings.seed } : {}),
...(options.modelId != null || imageSettings.modelId != null ? { modelId: options.modelId || imageSettings.modelId } : {}),
...(options.jobId != null || imageSettings.jobId != null ? { jobId: options.jobId || imageSettings.jobId } : {}),
},
runtime
);
Expand Down

0 comments on commit ba0b324

Please sign in to comment.