Seed

시드

The integer that starts a generation’s random number generator. The same seed plus the same settings always produces the same image.

Also known as: Random seedNoise seed
···
html
<div class="wrap">
  <canvas id="cv"></canvas>
  <div class="panel"><span class="lblseed">seed <b id="seedval">-</b></span><span class="tag" id="tag"></span></div>
</div>
css
.wrap{position:relative;width:100%;height:100%}
#cv{position:absolute;inset:0;width:100%;height:100%}
.panel{position:absolute;top:10px;left:10px;right:10px;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:7px 10px;border-radius:10px;background:rgba(13,13,18,0.55);backdrop-filter:blur(6px);border:1px solid rgba(255,255,255,0.15)}
.lblseed{font-family:ui-monospace,monospace;font-size:11.5px;color:#f1f0ec}
.lblseed b{color:var(--accent)}
.tag{font-size:10.5px;font-weight:700;color:#b7b7c2}
js
const cv = document.getElementById('cv'), ctx = cv.getContext('2d');
const seedval = document.getElementById('seedval'), tag = document.getElementById('tag');
function fit() { const dpr = Math.min(devicePixelRatio || 1, 2); cv.width = innerWidth * dpr; cv.height = innerHeight * dpr; ctx.setTransform(dpr, 0, 0, dpr, 0, 0); }
addEventListener('resize', fit); fit();

function mulberry32(a) { return function () { a |= 0; a = a + 0x6D2B79F5 | 0; let t = Math.imul(a ^ a >>> 15, 1 | a); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }

function scene(seed) {
  const w = innerWidth, h = innerHeight;
  const r = mulberry32(seed);
  const hue = Math.floor(r() * 360);
  const g = ctx.createLinearGradient(0, 0, 0, h);
  g.addColorStop(0, 'hsl(' + hue + ' 55% 68%)'); g.addColorStop(1, 'hsl(' + ((hue + 30) % 360) + ' 45% 36%)');
  ctx.fillStyle = g; ctx.fillRect(0, 0, w, h);
  ctx.beginPath(); ctx.arc(w * (0.2 + r() * 0.6), h * (0.18 + r() * 0.12), Math.min(w, h) * 0.07, 0, Math.PI * 2);
  ctx.fillStyle = 'hsl(' + ((hue + 180) % 360) + ' 85% 70%)'; ctx.fill();
  for (let l = 0; l < 3; l++) {
    ctx.beginPath(); ctx.moveTo(0, h);
    for (let i = 0; i <= 7; i++) { const x = w * i / 7; const y = h * (0.5 + l * 0.13) - r() * h * 0.1; ctx.lineTo(x, y); }
    ctx.lineTo(w, h); ctx.closePath();
    ctx.fillStyle = 'hsl(' + ((hue + l * 20) % 360) + ' 40% ' + (18 + l * 10) + '%)'; ctx.fill();
  }
}

const A = 48213, B = 91027;
let seedNow = A;
function step() {
  scene(seedNow); seedval.textContent = seedNow; tag.textContent = '생성됨';
  setTimeout(() => {
    scene(seedNow); tag.textContent = '같은 시드로 재생성 → 동일한 이미지';
    setTimeout(() => {
      seedNow = seedNow === A ? B : A;
      scene(seedNow); seedval.textContent = seedNow; tag.textContent = '시드 변경 → 다른 이미지';
      setTimeout(step, 2000);
    }, 1800);
  }, 1800);
}
step();

A diffusion model starts from a tensor of pure noise and gradually refines it into an image. That starting noise looks random, but it is actually produced by a pseudo-random generator, and that generator is fully determined by a single integer: the seed. Fix the seed, and the entire seemingly-random process reproduces exactly.

This is useful for controlled comparisons. Holding the seed fixed while changing only the prompt or the CFG scale lets you tell whether a difference came from that change or just from different noise. A seed worth keeping can be written down and reloaded later.

Seed reproducibility is not absolute, though. A different sampler, different numerical precision, or even different hardware can produce a slightly different result from the same seed — it is safer to assume reproducibility holds only within the same code and environment.

The demo below uses a deterministic pseudo-random generator (mulberry32) seeded by a number to draw a procedural picture, directly showing "same seed = same picture, different seed = different picture" instead of a real model.

When to use

Lock the seed when you want to isolate the effect of one parameter from everything else. Leave it random when you want to keep exploring a spread of different results.