save work

This commit is contained in:
2025-08-22 21:50:40 +02:00
parent 0415eb9df0
commit 888b27e275
4 changed files with 193 additions and 3 deletions

View File

@ -4,6 +4,12 @@ import { generateImage } from './lib/image-generator';
import { generateVideo } from './lib/video-generator';
import { logger } from './lib/logger';
import * as fs from 'fs/promises';
import dotenv from 'dotenv';
dotenv.config();
const COMFY_BASE_URL = process.env.COMFY_BASE_URL1 || "";
const COMFY_OUTPUT_DIR = process.env.COMFY_OUTPUT_DIR1 || "";
async function prepareImageForKeyword(keyword: string): Promise<{ keyword: string; generatedImagePath: string } | null> {
const numberOfPages = 1;
@ -49,6 +55,8 @@ async function prepareImageForKeyword(keyword: string): Promise<{ keyword: strin
const generatedImagePath = await generateImage(
imagePrompt,
imageFileName,
COMFY_BASE_URL,
COMFY_OUTPUT_DIR,
'flux',
{ width: 720, height: 1280 }
);
@ -81,6 +89,8 @@ async function generateVideoFromImagePath(keyword: string, generatedImagePath: s
videoPrompt,
generatedImagePath,
videoFileName,
COMFY_BASE_URL,
COMFY_OUTPUT_DIR,
{ width: 720, height: 1280 }
);
logger.debug(`Generated video from prompt, saved to: ${generatedVideoPath}`);