Pix2Pix — U-Net generator, PatchGAN discriminator
input x
edge map
U-Net generator G(x)
skip connections preserve high-freq detail
output ŷ
photo
target y
L1
λ = 100
PatchGAN D(x, ŷ)
output is an N × N grid
each cell judges ~70×70 patch
averaged → real / fake score
objective
L_G = -log D(x, G(x)) + 100 · ||y - G(x)||_1
L_D = -log D(x, y) - log (1 - D(x, G(x)))
L1 stabilizes + sharp edges; adv term fights blur
CycleGAN (unpaired): add a second G and a cycle-consistency loss
G: X -> Y, F: Y -> X, loss += ||F(G(x)) - x||_1 + ||G(F(y)) - y||_1
no paired data needed; horses <-> zebras, summer <-> winter
2026: mostly superseded by ControlNet + IP-Adapter over diffusion