CoolFace
Modelpublic

fusing/karlo_unclip

sourceHugging Faceupdated 4y agoView on Hugging Face
1likes22downloads
README.md31 linesDownload Raw Back to root
1```python2import os3os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"4 5from diffusers import UnCLIPPipeline6import torch7import random8import numpy as np9 10def set_seed(seed: int):11    random.seed(seed)12    np.random.seed(seed)13    torch.manual_seed(seed)14    torch.cuda.manual_seed_all(seed)15 16set_seed(0)17 18torch.backends.cuda.matmul.allow_tf32 = False19torch.use_deterministic_algorithms(True)20 21pipe = UnCLIPPipeline.from_pretrained("fusing/karlo_unclip", torch_dtype=torch.float16)22pipe = pipe.to('cuda')23 24prompt = "a high-resolution photograph of a big red frog on a green leaf."25 26image = pipe([prompt]).images[0]27 28image.save("frog.png")29```30 31![img](https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/frog.png)