Friday, July 12, 2024

AuraFlow - Best and Free Text to Image Model - Install Locally

 This video installs AuraFlow v0.1 locally which is the fully open-sourced largest flow-based text-to-image generation model. It generates hyper realistic images from text prompts.



Code:

conda create -n auraflow python=3.11 -y && conda activate auraflow

pip install transformers accelerate protobuf sentencepiece
pip install torch torchvision

pip install git+https://github.com/huggingface/diffusers.git@bbd2f9d4e9ae70b04fedf65903fd1fb035437db4

conda install jupyter -y
pip uninstall charset_normalizer -y
pip install charset_normalizer
jupyter notebook


from diffusers import AuraFlowPipeline
import torch

pipeline = AuraFlowPipeline.from_pretrained(
    "fal/AuraFlow",
    torch_dtype=torch.float16
).to("cuda")

image = pipeline(
    prompt="close-up portrait of a majestic iguana with vibrant blue-green scales, piercing amber eyes, and orange spiky crest. Intricate textures and details visible on scaly skin. Wrapped in dark hood, giving regal appearance. Dramatic lighting against black background. Hyper-realistic, high-resolution image showcasing the reptile's expressive features and coloration.",
    height=1024,
    width=1024,
    num_inference_steps=50,
    generator=torch.Generator().manual_seed(666),
    guidance_scale=3.5,
).images[0]

No comments: