update
This commit is contained in:
		
							
								
								
									
										24
									
								
								mock/volces.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								mock/volces.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
import dotenv from 'dotenv';
 | 
			
		||||
import util from 'node:util';
 | 
			
		||||
 | 
			
		||||
dotenv.config({ path: '.env' });
 | 
			
		||||
 | 
			
		||||
import { VolcesImage } from '../src/volces/image.ts';
 | 
			
		||||
 | 
			
		||||
const main = async () => {
 | 
			
		||||
  const volces = new VolcesImage(process.env.VOLECS_API_KEY || '');
 | 
			
		||||
  const resp = await volces.generateImage({
 | 
			
		||||
    model: 'doubao-seedream-4-0-250828',
 | 
			
		||||
    prompt: '一个可爱的小的熊猫,卡通风格,抱着竹子。旁边有一个卡通的奶牛的毛绒玩具。',
 | 
			
		||||
    sequential_image_generation: 'auto',
 | 
			
		||||
    sequential_image_generation_options: { max_images: 3 },
 | 
			
		||||
    response_format: 'url',
 | 
			
		||||
    size: '2K',
 | 
			
		||||
    stream: false,
 | 
			
		||||
    watermark: false
 | 
			
		||||
  });
 | 
			
		||||
  console.log('response:', resp);
 | 
			
		||||
  // console.log(util.inspect(resp, { depth: null, colors: true }));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
main()
 | 
			
		||||
		Reference in New Issue
	
	Block a user