Update scripts: move CSV to repo root, tune flux-2-pro params

- Point both generate scripts to final_cocktails.csv at repo root instead
  of prototype/uploads/final_cocktails.csv
- Add final_cocktails.csv to repo
- Switch flux-2-pro to input_images[], resolution "2 MP", output_quality 100
- Lower safety_tolerance from 6 → 2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 12:04:00 +02:00
parent b3b9fb7ac6
commit 5ca68c1b04
3 changed files with 688 additions and 9 deletions
+5 -8
View File
@@ -24,7 +24,7 @@ import Replicate from "replicate";
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = join(__dirname, "..");
const CSV_PATH = join(ROOT, "prototype/uploads/final_cocktails.csv");
const CSV_PATH = join(ROOT, "final_cocktails.csv");
const CONTENT_DIR = join(ROOT, "content/recipes");
const PROMPT = `A high-end, professional commercial photograph of the cocktail from the reference image. The drink retains its original vibrant color hue, served in the exact same glass type with identical decorations details. The liquid has a crisp, realistic texture with subtle condensation droplets on the outside of the glassware. The cocktail is set against a modern, moody, and minimalist bar background with soft, cinematic bokeh. Elegant, dramatic studio lighting casts a gentle glow on the glass, creating sharp reflections and a premium, editorial aesthetic fit for a luxury cocktail book. Photorealistic, 8k resolution, crisp focus.`;
@@ -85,15 +85,12 @@ async function generateImage(replicate, cocktail, index, total) {
prompt: PROMPT,
output_format: "webp",
aspect_ratio: "1:1",
safety_tolerance: 6,
safety_tolerance: 2,
resolution: "2 MP",
input_images: [thumbnail],
output_quality: 100,
};
// Add reference image if thumbnail URL exists
if (thumbnail) {
input.image = thumbnail;
input.image_prompt_strength = 0.15;
}
const output = await replicate.run("black-forest-labs/flux-2-pro", { input });
// Output is either a URL string or a ReadableStream