Skip to content

Commit ba0b324

Browse files
committed
use imageSettings from character file
while still retaining the ability to call via options with js
1 parent 9d862dd commit ba0b324

File tree

1 file changed

+9
-17
lines changed
  • packages/plugin-image-generation/src

1 file changed

+9
-17
lines changed

packages/plugin-image-generation/src/index.ts

+9-17
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,15 @@ const imageGeneration: Action = {
131131
const images = await generateImage(
132132
{
133133
prompt: imagePrompt,
134-
width: options.width || 1024,
135-
height: options.height || 1024,
136-
...(options.count != null ? { count: options.count || 1 } : {}),
137-
...(options.negativePrompt != null
138-
? { negativePrompt: options.negativePrompt }
139-
: {}),
140-
...(options.numIterations != null
141-
? { numIterations: options.numIterations }
142-
: {}),
143-
...(options.guidanceScale != null
144-
? { guidanceScale: options.guidanceScale }
145-
: {}),
146-
...(options.seed != null ? { seed: options.seed } : {}),
147-
...(options.modelId != null
148-
? { modelId: options.modelId }
149-
: {}),
150-
...(options.jobId != null ? { jobId: options.jobId } : {}),
134+
width: options.width || imageSettings.width || 1024,
135+
height: options.height || imageSettings.height || 1024,
136+
...(options.count != null || imageSettings.count != null ? { count: options.count || imageSettings.count || 1 } : {}),
137+
...(options.negativePrompt != null || imageSettings.negativePrompt != null ? { negativePrompt: options.negativePrompt || imageSettings.negativePrompt } : {}),
138+
...(options.numIterations != null || imageSettings.numIterations != null ? { numIterations: options.numIterations || imageSettings.numIterations } : {}),
139+
...(options.guidanceScale != null || imageSettings.guidanceScale != null ? { guidanceScale: options.guidanceScale || imageSettings.guidanceScale } : {}),
140+
...(options.seed != null || imageSettings.seed != null ? { seed: options.seed || imageSettings.seed } : {}),
141+
...(options.modelId != null || imageSettings.modelId != null ? { modelId: options.modelId || imageSettings.modelId } : {}),
142+
...(options.jobId != null || imageSettings.jobId != null ? { jobId: options.jobId || imageSettings.jobId } : {}),
151143
},
152144
runtime
153145
);

0 commit comments

Comments
 (0)