Download abc.py from hadao/abc: direct link, hf CLI and curl.
- Browser
- Download file 525 Bytes
-
https://huggingface.co/hadao/abc/resolve/main/abc.py
- Command line
-
hf download hf://hadao/abc/abc.py
-
curl -L -o abc.py https://huggingface.co/hadao/abc/resolve/main/abc.py
525 Bytes
| import torch | |
| from diffusers import FluxPipeline | |
| pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16) | |
| pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power | |
| prompt = "A cat holding a sign that says hello world" | |
| image = pipe( | |
| prompt, | |
| guidance_scale=0.0, | |
| num_inference_steps=4, | |
| max_sequence_length=256, | |
| generator=torch.Generator("cpu").manual_seed(0) | |
| ).images[0] | |
| image.save("flux-schnell.png") |