@@ -120,6 +120,9 @@ const imageGeneration: Action = {
120
120
const imagePrompt = message . content . text ;
121
121
elizaLogger . log ( "Image prompt received:" , imagePrompt ) ;
122
122
123
+ const imageSettings = runtime . character ?. settings ?. imageSettings || { } ;
124
+ elizaLogger . log ( "Image settings:" , imageSettings ) ;
125
+
123
126
// TODO: Generate a prompt for the image
124
127
125
128
const res : { image : string ; caption : string } [ ] = [ ] ;
@@ -128,23 +131,15 @@ const imageGeneration: Action = {
128
131
const images = await generateImage (
129
132
{
130
133
prompt : imagePrompt ,
131
- width : options . width || 1024 ,
132
- height : options . height || 1024 ,
133
- ...( options . count != null ? { count : options . count || 1 } : { } ) ,
134
- ...( options . negativePrompt != null
135
- ? { negativePrompt : options . negativePrompt }
136
- : { } ) ,
137
- ...( options . numIterations != null
138
- ? { numIterations : options . numIterations }
139
- : { } ) ,
140
- ...( options . guidanceScale != null
141
- ? { guidanceScale : options . guidanceScale }
142
- : { } ) ,
143
- ...( options . seed != null ? { seed : options . seed } : { } ) ,
144
- ...( options . modelId != null
145
- ? { modelId : options . modelId }
146
- : { } ) ,
147
- ...( 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 } : { } ) ,
148
143
} ,
149
144
runtime
150
145
) ;
0 commit comments