Prompt Formula Builder
Pick subject, angle, lighting, texture and lens, and get a copy-ready prompt with a before and after comparison.
AI prompt
[Subject], [camera angle], [lighting], [material and texture], shot on a [lens], [mood], [colour palette], high detail, photographic realism. Example: a ceramic teapot on a wooden table, low angle shot, golden hour side light, matte glazed ceramic with visible clay grain, shot on an 85mm lens at f/2, calm warm mood, earth-tone palette, high detail, photographic realism. Build the prompt in this order because models weigh early words more. Change only one part between generations to see its effect. Before and after: "a ceramic teapot" gives a generic result, while the full formula controls viewpoint, light, material and focus. Negative prompt template: low quality, blurry, distorted proportions, extra objects, text, watermark.About this pattern
Definition
A prompt formula joins the parts that most affect an AI image: [subject] + [angle] + [lighting] + [texture] + [lens]. Choosing each part from a list keeps prompts consistent and easy to vary.
When to use it
- Beginners often write only the subject; adding the other four parts makes results far more specific.
- Change one part at a time to learn what each keyword does.
- Keep a formula for your project so every image shares the same look.
What the controls do
- Subject field and four menus; Shuffle picks a random combination; Copy puts the prompt on the clipboard and confirms in text.
Motion & timing
- The result text fades in for 160ms when it changes.
- Reduced motion: it changes instantly.
Tips & variations
- The result wraps and can be copied in one press, on desktop or phone.
- Add your own words to the subject field; the other parts come from the menus.
Code of this live preview
<div class="bx"><label>Subject <input id="sub" type="text" value="a ceramic teapot on a wooden table" maxlength="80"></label>
<div class="sel"><label>Angle <select id="ang"><option>eye-level shot</option><option>low angle shot</option><option>overhead top-down shot</option><option>POV shot</option><option>isometric view</option></select></label>
<label>Lighting <select id="lig"><option>golden hour side light</option><option>Rembrandt lighting</option><option>rim light on a dark background</option><option>soft overcast light</option><option>neon cyberpunk glow</option></select></label>
<label>Texture <select id="tex"><option>matte glazed ceramic with visible clay grain</option><option>brushed metal</option><option>frosted glass</option><option>rough paper with film grain</option><option>bouclé fabric</option></select></label>
<label>Lens <select id="len"><option>35mm lens</option><option>85mm lens at f/1.8</option><option>macro 100mm lens</option><option>16mm ultra-wide lens</option></select></label></div>
<p class="lb">Before</p><p class="res before" id="bef"></p><p class="lb">After <span class="act"><button id="shuf" type="button">Shuffle</button><button id="cp" type="button">Copy</button></span></p><p class="res" id="aft" aria-live="polite"></p></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
.bx{width:min(320px,100%);display:grid;gap:6px;font-size:12px}
label{display:grid;gap:3px;color:var(--muted);font-size:11px}
input[type=text],select{width:100%;height:30px;padding:0 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font:inherit;font-size:12px;color:var(--text)}
.sel{display:grid;grid-template-columns:1fr 1fr;gap:6px}
input:focus-visible,select:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.lb{display:flex;justify-content:space-between;align-items:center;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-top:2px}
.res{padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-size:12px;line-height:1.45;animation:fd .16s ease-out}
.res.before{color:var(--muted)}
.act{display:flex;gap:5px}
.act button{height:24px;padding:0 10px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font:inherit;font-size:11px;cursor:pointer;text-transform:none;letter-spacing:0}
.act button:hover{border-color:var(--accent)}
@keyframes fd{from{opacity:.3}}
@media (prefers-reduced-motion:reduce){.res{animation:none}}const $=id=>document.getElementById(id),sub=$('sub'),ang=$('ang'),lig=$('lig'),tex=$('tex'),len=$('len'),bef=$('bef'),aft=$('aft'),cp=$('cp');
function build(){const s=sub.value.trim()||'a subject';bef.textContent=s;aft.textContent=s+', '+ang.value+', '+lig.value+', '+tex.value+', shot on a '+len.value+', high detail, photographic realism';}
[sub,ang,lig,tex,len].forEach(e=>e.addEventListener('input',build));build();
$('shuf').addEventListener('click',()=>{[ang,lig,tex,len].forEach(s=>{s.selectedIndex=Math.floor(Math.random()*s.options.length);});build();});
cp.addEventListener('click',()=>{const t=aft.textContent,done=ok=>{cp.textContent=ok?'Copied':'Press Ctrl+C';setTimeout(()=>cp.textContent='Copy',1400);};
const fb=()=>{const r=document.createRange();r.selectNodeContents(aft);const g=getSelection();g.removeAllRanges();g.addRange(r);let ok=false;try{ok=document.execCommand('copy');}catch(e){}done(ok);};
if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(t).then(()=>done(true),fb);else fb();});One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Prompt Formula Builder — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.bx{width:min(320px,100%);display:grid;gap:6px;font-size:12px}
label{display:grid;gap:3px;color:var(--muted);font-size:11px}
input[type=text],select{width:100%;height:30px;padding:0 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font:inherit;font-size:12px;color:var(--text)}
.sel{display:grid;grid-template-columns:1fr 1fr;gap:6px}
input:focus-visible,select:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.lb{display:flex;justify-content:space-between;align-items:center;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-top:2px}
.res{padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-size:12px;line-height:1.45;animation:fd .16s ease-out}
.res.before{color:var(--muted)}
.act{display:flex;gap:5px}
.act button{height:24px;padding:0 10px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font:inherit;font-size:11px;cursor:pointer;text-transform:none;letter-spacing:0}
.act button:hover{border-color:var(--accent)}
@keyframes fd{from{opacity:.3}}
@media (prefers-reduced-motion:reduce){.res{animation:none}}
</style></head>
<body><div class="stage">
<div class="bx"><label>Subject <input id="sub" type="text" value="a ceramic teapot on a wooden table" maxlength="80"></label>
<div class="sel"><label>Angle <select id="ang"><option>eye-level shot</option><option>low angle shot</option><option>overhead top-down shot</option><option>POV shot</option><option>isometric view</option></select></label>
<label>Lighting <select id="lig"><option>golden hour side light</option><option>Rembrandt lighting</option><option>rim light on a dark background</option><option>soft overcast light</option><option>neon cyberpunk glow</option></select></label>
<label>Texture <select id="tex"><option>matte glazed ceramic with visible clay grain</option><option>brushed metal</option><option>frosted glass</option><option>rough paper with film grain</option><option>bouclé fabric</option></select></label>
<label>Lens <select id="len"><option>35mm lens</option><option>85mm lens at f/1.8</option><option>macro 100mm lens</option><option>16mm ultra-wide lens</option></select></label></div>
<p class="lb">Before</p><p class="res before" id="bef"></p><p class="lb">After <span class="act"><button id="shuf" type="button">Shuffle</button><button id="cp" type="button">Copy</button></span></p><p class="res" id="aft" aria-live="polite"></p></div>
</div>
<script>
const $=id=>document.getElementById(id),sub=$('sub'),ang=$('ang'),lig=$('lig'),tex=$('tex'),len=$('len'),bef=$('bef'),aft=$('aft'),cp=$('cp');
function build(){const s=sub.value.trim()||'a subject';bef.textContent=s;aft.textContent=s+', '+ang.value+', '+lig.value+', '+tex.value+', shot on a '+len.value+', high detail, photographic realism';}
[sub,ang,lig,tex,len].forEach(e=>e.addEventListener('input',build));build();
$('shuf').addEventListener('click',()=>{[ang,lig,tex,len].forEach(s=>{s.selectedIndex=Math.floor(Math.random()*s.options.length);});build();});
cp.addEventListener('click',()=>{const t=aft.textContent,done=ok=>{cp.textContent=ok?'Copied':'Press Ctrl+C';setTimeout(()=>cp.textContent='Copy',1400);};
const fb=()=>{const r=document.createRange();r.selectNodeContents(aft);const g=getSelection();g.removeAllRanges();g.addRange(r);let ok=false;try{ok=document.execCommand('copy');}catch(e){}done(ok);};
if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(t).then(()=>done(true),fb);else fb();});
</script>
</body></html>