#!/usr/bin/env php query("SELECT id,pid,name,kind FROM fa_fc_category WHERE enabled=1 ORDER BY pid,sort,id")->fetchAll(PDO::FETCH_ASSOC); $mapJson = file_get_contents(__DIR__ . '/map.json'); $map = json_decode($mapJson, true); $NO_TEXT = ", no text, no watermark, no logo, no signature, no artist tag, no caption, no brand mark, no AI generated label, no corner badge, no copyright mark, no overlay text"; function vegeEn($name, $map) { foreach ($map['vege_en_hint'] as $k => $v) if ($k === $name) return $v; return $name; } $items = []; foreach ($rows as $r) { if ($r['pid'] == 0) continue; $id = $r['id']; $name = $r['name']; $kind = $r['kind']; $outPath = 'D:/Softwares/phpstudy_pro/WWW/fenleixinxi/tmp_img/downloaded/' . $id . '.jpg'; if ($kind === 'farm') { $en = vegeEn($name, $map); $prompt = "a bamboo basket full of fresh $en, placed on the soil of a $en farm or orchard field, background with rows of naturally growing $en plants or trees, natural daylight, bright fresh mint green mood, realistic photography style, close-up composition, 1:1 square$NO_TEXT"; } else { $live = null; foreach ($map['live_animal_map'] as $k => $v) if ($k === $name) { $live = $v; break; } if ($live) { $prompt = "a herd of $live grazing or standing naturally on a green grass pasture or farmhouse courtyard, background with distant hills and blue sky, natural daylight, bright fresh mint green mood, realistic photography style, wide shot, 1:1 square composition$NO_TEXT"; } elseif (in_array($name, $map['egg_list'])) { $en = vegeEn($name, $map); $prompt = "a bamboo basket full of fresh $en with some green plants and straw decoration, placed on a rustic wooden table in a sunny farmhouse courtyard, natural daylight, warm pastoral mood with fresh mint green undertone, realistic photography, 1:1 square$NO_TEXT"; } elseif (in_array($name, $map['water_list'])) { $prompt = "a natural fish pond with various live fish swimming in clear blue water, surrounded by green grass and reed, natural daylight, fresh mint green mood, realistic photography, 1:1 square composition$NO_TEXT"; } elseif (in_array($name, $map['processed_list'])) { $en = vegeEn($name, $map); $prompt = "fresh $en arranged nicely on a rustic wooden table, background with farmhouse kitchen or market stall setting, natural daylight, fresh mint green mood, realistic photography style, close-up, 1:1 square$NO_TEXT"; } else { $en = vegeEn($name, $map); $prompt = "a bamboo basket full of fresh $en, placed on the soil of a $en farm or orchard field, background with rows of naturally growing $en plants or trees, natural daylight, bright fresh mint green mood, realistic photography style, close-up composition, 1:1 square$NO_TEXT"; } } $items[] = [ 'id' => $id, 'name' => $name, 'kind' => $kind, 'path' => $outPath, 'prompt' => $prompt, ]; } file_put_contents(__DIR__ . '/prompt_map.json', json_encode($items, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); echo "exported " . count($items) . " prompts\n";