add png compression to save space
Some checks failed
ci/woodpecker/push/ci Pipeline failed

This commit is contained in:
Madison Grubb
2025-09-04 22:48:11 -04:00
parent f51a5a6e0c
commit df08a6bf42
4 changed files with 51 additions and 3 deletions

View File

@@ -2,12 +2,13 @@ import path from "path";
import { mkdir, writeFile } from "fs/promises";
import { fileURLToPath } from "url";
import { callOllama } from "./ollamaClient.js";
import { compressPng } from "./compressPng.js";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const COMFYUI_URL = process.env.COMFYUI_URL || "http://localhost:8188";
// Drawing style prefix
const STYLE_PREFIX = `a high-contrast, black and white pen and ink drawing, hand-drawn sketch aesthetic, very low detail, visible loose linework, expressive simple hatching for shadows, quick conceptual sketch, subtle color accent`;
const STYLE_PREFIX = `a high-contrast, black and white pen and ink drawing, hand-drawn sketch aesthetic, very low detail, extremely minimal, visible loose linework, expressive simple hatching for shadows, quick conceptual sketch, subtle color accent`;
// 1. Generate engineered visual prompt
async function generateVisualPrompt(flavor) {
@@ -181,6 +182,9 @@ async function generateImageViaComfyUI(prompt, filename) {
console.log("Downloading image...");
const filepath = await downloadImage(comfyFilename, filename);
console.log("Compressing PNG...");
await compressPng(filepath);
return filepath;
} catch (err) {