save current changes

This commit is contained in:
2025-08-16 11:13:04 +02:00
parent 1d378962b0
commit fbe1ceafaf
8 changed files with 1230 additions and 7 deletions

View File

@ -1 +1,29 @@
console.log("Hello, TypeScript! 2");
import { downloadPinterestImages } from './lib/downloader';
import { describeImage } from './lib/image-describer';
import { logger, setLogLevel, LogLevel } from './lib/logger';
(async () => {
const keyword = 'cyberpunk city';
const numberOfPages = 1;
const imagePaths = await downloadPinterestImages(keyword, numberOfPages);
logger.info('Downloaded images:', imagePaths);
for (const imagePath of imagePaths) {
try {
const llmResponseJSON = await describeImage(imagePath,
`Describe this image as a prompt for an image generation model.
Prompt should be in 200 words.
Output should be in this format
---
{
"prompt":""
}
---
`);
const prompt = llmResponseJSON.prompt;
logger.info(`Description for ${imagePath}:`, prompt);
} catch (error) {
logger.error(`Failed to describe ${imagePath}:`, error);
}
}
})();