@@ -76,28 +76,72 @@ export const useJobCreator = ({
7676 const taskUUID = crypto . randomUUID ( ) ;
7777
7878 if ( mediaType === "image" ) {
79- const response = await runware . requestImages ( {
79+ const isIdeogram = endpointId . startsWith ( "ideogram:" ) ;
80+
81+ const imageParams : any = {
8082 positivePrompt : input . prompt || "" ,
8183 model : endpointId ,
8284 height : input . height || 1024 ,
8385 width : input . width || 1024 ,
8486 numberResults : input . numberResults || 1 ,
8587 outputType : "URL" as const ,
86- outputFormat : input . outputFormat || "JPEG" ,
87- checkNSFW : input . checkNSFW !== undefined ? input . checkNSFW : true ,
88- CFGScale : input . CFGScale || 3.5 ,
89- steps : input . steps || 28 ,
90- scheduler : input . scheduler || "Default" ,
88+ outputFormat : ( input . outputFormat || "JPG" ) as "JPG" | "PNG" | "WEBP" ,
9189 includeCost :
9290 input . includeCost !== undefined ? input . includeCost : true ,
93- outputQuality : input . outputQuality || 85 ,
94- ...input ,
95- } ) ;
96-
97- return {
98- taskUUID,
99- data : response ,
10091 } ;
92+
93+ if ( ! isIdeogram ) {
94+ imageParams . checkNSFW =
95+ input . checkNSFW !== undefined ? input . checkNSFW : true ;
96+ imageParams . CFGScale = input . CFGScale || 3.5 ;
97+ imageParams . outputQuality = input . outputQuality || 85 ;
98+
99+ if ( input . steps !== undefined ) {
100+ imageParams . steps = input . steps ;
101+ }
102+ }
103+
104+ console . log ( "[DEBUG] Runware requestImages - endpointId:" , endpointId ) ;
105+ console . log (
106+ "[DEBUG] Runware requestImages - params:" ,
107+ JSON . stringify ( imageParams , null , 2 ) ,
108+ ) ;
109+
110+ try {
111+ const response = await runware . requestImages ( imageParams ) ;
112+ console . log (
113+ "[DEBUG] Runware requestImages - SUCCESS:" ,
114+ JSON . stringify ( response , null , 2 ) ,
115+ ) ;
116+
117+ return {
118+ taskUUID,
119+ data : response ,
120+ } ;
121+ } catch ( error ) {
122+ console . error ( "[DEBUG] Runware requestImages - ERROR:" , error ) ;
123+ console . error (
124+ "[DEBUG] Runware requestImages - ERROR message:" ,
125+ ( error as any ) ?. message ,
126+ ) ;
127+ console . error (
128+ "[DEBUG] Runware requestImages - ERROR response:" ,
129+ ( error as any ) ?. response ,
130+ ) ;
131+ console . error (
132+ "[DEBUG] Runware requestImages - ERROR response data:" ,
133+ ( error as any ) ?. response ?. data ,
134+ ) ;
135+ console . error (
136+ "[DEBUG] Runware requestImages - ERROR response status:" ,
137+ ( error as any ) ?. response ?. status ,
138+ ) ;
139+ console . error (
140+ "[DEBUG] Runware requestImages - ERROR stringified:" ,
141+ JSON . stringify ( error , null , 2 ) ,
142+ ) ;
143+ throw error ;
144+ }
101145 }
102146 if ( mediaType === "video" ) {
103147 const runware = await getRunwareClient ( ) ;
@@ -143,22 +187,20 @@ export const useJobCreator = ({
143187 model : endpointId ,
144188 duration : input . duration || 30 ,
145189 outputFormat : "MP3" as const ,
190+ outputType : "URL" as const ,
146191 audioSettings : {
147192 bitrate : 128 ,
148193 sampleRate : 44100 ,
149194 } ,
150195 } ;
151196
152- console . log ( "[DEBUG] Calling runware.audioInference with:" , {
153- ... audioParams ,
154- outputType : [ "URL" ] ,
155- } ) ;
197+ console . log (
198+ "[DEBUG] Calling runware.audioInference with:" ,
199+ audioParams ,
200+ ) ;
156201
157202 try {
158- const response = await runware . audioInference ( {
159- ...audioParams ,
160- outputType : [ "URL" ] as any ,
161- } ) ;
203+ const response = await runware . audioInference ( audioParams ) ;
162204 console . log ( "[DEBUG] audioInference response:" , response ) ;
163205 console . log (
164206 "[DEBUG] audioInference response stringified:" ,
0 commit comments