feat: Add Jimeng image generation service and related functionality
- Implemented JimengService for image generation with API integration. - Created OSSService for handling image uploads to S3. - Developed PBService for managing PocketBase interactions. - Added task management for image creation and downloading using BullMQ. - Introduced routes for creating image generation tasks. - Implemented logging and error handling for image processing. - Added configuration management for Redis and other services. - Created scripts for testing image generation and PocketBase integration. - Updated package dependencies and added new scripts for worker management.
This commit is contained in:
18
prompts/test/jimeng.ts
Normal file
18
prompts/test/jimeng.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { JimengService } from '../src/services/jimeng.service.js';
|
||||
import { useConfig } from '@kevisual/use-config';
|
||||
const config = useConfig();
|
||||
|
||||
export const jimengService = new JimengService({
|
||||
apiKey: config.JIMENG_API_KEY,
|
||||
baseUrl: config.JIMENG_API_URL,
|
||||
timeout: parseInt(config.JIMENG_TIMEOUT || '30000'),
|
||||
});
|
||||
|
||||
const createImage = async () => {
|
||||
const response = await jimengService.generateImage({
|
||||
prompt: 'A beautiful landscape with mountains and a river, in the style of a watercolor painting',
|
||||
});
|
||||
console.log('Generated Image URL:', response);
|
||||
};
|
||||
|
||||
createImage();
|
||||
Reference in New Issue
Block a user