Instructions to use circulus/FLUX.2-klein-9B-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use circulus/FLUX.2-klein-9B-bnb-4bit with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("circulus/FLUX.2-klein-9B-bnb-4bit", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
| import torch | |
| from diffusers import Flux2KleinPipeline | |
| pipe = Flux2KleinPipeline.from_pretrained( | |
| "./FLUX.2-9B-bnb-4bit", | |
| torch_dtype=torch.bfloat16, | |
| device_map="cuda", # REQUIRED | |
| ) | |
| #pipe.to("cuda") | |
| #pipe.enable_model_cpu_offload() # save some VRAM by offloading the model to CPU | |
| from PIL import Image | |
| init_image = Image.open("suji.jpg").convert("RGB") | |
| #prompt = "an very beautiful sexy korean kpop young woman with white bikini is smiling on the waikiki beach. hiqh quality realistic photo."# pixar 3d style" | |
| #prompt = "beautiful woman in the beach holding plate with Circulus " | |
| prompt = "νΌλΆκ° λλ¬λλ ν°μ λλ μ€λ₯Ό μ μλ€." #νμμμ μΉμν λλ μ€λ₯Ό μ μ μλ¦λ€μ΄ νκ΅ μ¬μ±" | |
| image = pipe( | |
| prompt=prompt, | |
| image=init_image, | |
| height=1024, | |
| width=1024, | |
| guidance_scale=1.0, | |
| num_inference_steps=4, | |
| generator=torch.Generator(device="cuda").manual_seed(0) | |
| ).images[0] | |
| image.save("./output/flux_suji10.png") | |