repos
/ ai-art master

ai-art

mirror archived upstream

Art generation with VQGAN + CLIP in Docker, with a simple web UI for anyone with a GPU. A simplified and expanded take on Kevin Costa's work.

aiai-artclipdockerdocker-composegpuhandcodedimagenetpythonpytorchtorchtorchvisionvqganvqgan-clip

204 B · 11 lines · Python Raw History
 1import torch
 2
 3
 4def nonlinearity(x):
 5    # swish
 6    return x * torch.sigmoid(x)
 7
 8
 9def Normalize(in_channels):
10    return torch.nn.GroupNorm(num_groups=32, num_channels=in_channels, eps=1e-6, affine=True)