Scribble at 2026-04-10 07:01:48 Last modified: 2026-04-10 16:59:13
景観用のプロンプトを自動でランダムに生成する仕組みを作って運用を試している。出来栄えの画像は、相変わらず凡庸なスナップ写真みたいな情景が多いけれど、それなりにストリート・カメラマンの作品に似た結果もあるため、少しずつ調整しながらシステム・プロンプトを洗練させたい。
しくみは非常に簡単で、このフォームには実行ボタン以外に何の入力項目もないから、別にコマンド・プロンプトで % php -f filename.php を叩いても同じだし Orchis から直に実行するショートカットを作ってもいいのだが、気軽に実行できるようにしてある。実行すると、地名の一覧ファイルと景観や眺める対象の一覧ファイルとから、"A black and white photography at Granada in Spain, in style of Michael Kenna, with controlled lighting, candid composition, structured compositions." のようなテーマとなるフレーズを作って、これを元に Gemma 4 E4B IT に情景のストーリーを一つの段落として作成してもらう(太字の部分がランダムに変わる)。その結果が、"A black and white photography at Granada in Spain, in style of Michael Kenna, with controlled lighting, candid composition, structured compositions. A high-contrast, large-format silver gelatin print captures the dense, textured geometry of an acacia forest interior. Deep shadows pool in the undergrowth, contrasting with sharply defined highlights catching the rough, desiccated texture of bark and fallen detritus, exhibiting complex micro-contrast across the tonal range. A subtle S-curve formed by receding vertical trunks guides the eye toward a distant, tiered farmland vista, rendered with precise spatial frequency. Atmospheric luminance sculpts the volumetric depth, where the foreground detail resolves sharply against a soft, creamy bokeh of receding foliage, establishing a deep spatial plane with an aesthetic distance emphasizing environmental harmony." という自然文のプロンプトになる。これを、いちどに10個ずつ自動で作らせるのだ。ちなみに、僕の旧マシン(Ryzen 5 2600 + 16 GB RAM + GeForce RTX 2060 6 GB)だと10個のプロンプトを作るのに、おおよそ1分かかる(初回だけモデルをロードして3分ほどかかる)。
なお、先日の落書きでは LM Studio でプロンプトを作らせた事例を紹介したが、この落書きでご紹介しているシステムは、同じく Gemma 4 E4B IT GGUF を使っているけれど、実行しているのは LM Studio の API サーバではなく Ollama のサーバだ。