Downloads · 30 days
74
16% of all-time downloads
sayakpaul/trained-lumina2-lora-yarn
trained-lumina2-lora-yarn is a text-to-image model from sayakpaul. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as apache-2.0.
Downloads · 30 days
74
16% of all-time downloads
All-time downloads
466
Public
Repo size
7.7 MB
Likes
3
Public
Click a slice to open those files.
.png4 MB · 52%
From the Hugging Face model README
These are trained-lumina2-lora-yarn DreamBooth LoRA weights for Alpha-VLLM/Lumina-Image-2.0.
The weights were trained using DreamBooth with the Lumina2 diffusers trainer.
You should use yarn art style to trigger the image generation.
The following system_prompt was also used used during training (ignore if None): None.
Download the *.safetensors LoRA in the Files & versions tab.
import torch
from diffusers import Lumina2Text2ImgPipeline
pipe = Lumina2Text2ImgPipeline.from_pretrained(
"Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16
).to("cuda")
pipe.load_lora_weights("trained-lumina2-lora-yarn")
prompt = "a puppy in a pond, yarn art style"
image = pipe(
prompt,
negative_prompt="bad quality, worse quality, degenerate quality",
guidance_scale=6,
num_inference_steps=35,
generator=torch.manual_seed(0)
).images[0]
For more details, including weighting, merging and fusing LoRAs, check the documentation on loading LoRAs in diffusers.
The model benefits from system_prompt. Here is a comparison across different system prompts:
import torch
from diffusers import Lumina2Text2ImgPipeline
pipe = Lumina2Text2ImgPipeline.from_pretrained(
"Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16
).to("cuda")
system_prompts = [
None,
"You are an assistant designed to generate superior images with a dark overall theme.",
"You are an assistant designed to generate superior images with a bright and shiny overall theme."
]
pipe.load_lora_weights("trained-lumina2-lora-yarn")
prompt = "a puppy in a pond, yarn art style"
for sp in system_prompts:
filename = "yarn_lora"
image = pipe(
prompt,
negative_prompt="bad quality, worse quality, degenerate quality",
system_prompt=sp,
guidance_scale=6,
num_inference_steps=35,
generator=torch.manual_seed(0)
).images[0]
if sp:
filename += "_" + "_".join(sp.split(" ")).replace(",", "").replace(".", "")
filename = filename[:100]
image.save(f"{filename}.png")
</details>