File tree Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ export default {
9595      modelId, 
9696      guidance_scale : guidanceScale , 
9797      num_inference_steps : numInferenceSteps , 
98-       seed :  seed 
98+       seed, 
9999    } ; 
100100
101101    const  response  =  await  this . app . _makeRequest ( { 
@@ -105,7 +105,7 @@ export default {
105105      data, 
106106    } ) ; 
107107
108-     $ . export ( "$summary" ,  `Successfully generated ${ numImages }  ) ;      
108+     $ . export ( "$summary" ,  `Successfully generated ${ numImages }  ) ; 
109109    return  response ; 
110110  } , 
111111} ; 
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export default {
5252      motionStrength, 
5353      isPublic, 
5454      isInitImage, 
55-       isVariation,        
55+       isVariation, 
5656    } ; 
5757
5858    const  response  =  await  this . app . _makeRequest ( { 
Original file line number Diff line number Diff line change @@ -64,17 +64,20 @@ export default {
6464
6565    const  {  uploadInitImage }  =  uploadResponse ; 
6666    const  fields  =  JSON . parse ( uploadInitImage . fields ) ; 
67-     const  formData  =  new  FormData ( ) ;      
67+     const  formData  =  new  FormData ( ) ; 
6868
69-     //Important: Order of fields is sanctioned by Leonardo AI API. Fields should go first, then the file 
70-     for  ( const  [ label ,  value ]  of  Object . entries ( fields ) )  { 
69+     //Important: Order of fields is sanctioned by Leonardo AI API. Fields go first, then the file 
70+     for  ( const  [ 
71+       label , 
72+       value , 
73+     ]  of  Object . entries ( fields ) )  { 
7174      formData . append ( label ,  value . toString ( ) ) ; 
72-     }      
75+     } 
7376    formData . append ( "file" ,  stream ,  { 
7477      contentType : metadata . contentType , 
7578      knownLength : metadata . size , 
7679      filename : metadata . name , 
77-     } ) ;      
80+     } ) ; 
7881    const  uploadUrl  =  uploadInitImage . url ; 
7982
8083    // Step 2: Upload the file to the presigned URL 
Original file line number Diff line number Diff line change 11import  {  axios  }  from  "@pipedream/platform" ; 
2- import  FormData  from  "form-data" ; 
32
43export  default  { 
54  type : "app" , 
@@ -17,13 +16,16 @@ export default {
1716      } ; 
1817    } , 
1918    async  _makeRequest ( { 
20-       $ =  this ,   
21-       method =  "GET" ,   
22-       path,   
23-       data,   
19+       $ =  this , 
20+       method =  "GET" , 
21+       path, 
22+       data, 
2423      ...opts 
2524    } )  { 
26-       const  {  headers : userHeaders ,  ...rest  }  =  opts ; 
25+       const  { 
26+         headers : userHeaders , 
27+         ...rest 
28+       }  =  opts ; 
2729      const  config  =  { 
2830        method, 
2931        ...rest , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments