Run this model with HF Jobs

Run sayakpaul/trained-lumina2-lora-yarn on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/sayakpaul/trained-lumina2-lora-yarn. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/sayakpaul/trained-lumina2-lora-yarn on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Lumina2 DreamBooth LoRA - trained-lumina2-lora-yarn

Prompt
a puppy in a pond, yarn art style
Prompt
a puppy in a pond, yarn art style (dark env)
Prompt
a puppy in a pond, yarn art style (shiny env)

Model description

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.

Trigger words

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 model

Download the *.safetensors LoRA in the Files & versions tab.

Use it with the 🧨 diffusers library

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.

Results

The model benefits from system_prompt. Here is a comparison across different system prompts:

No system prompt "Dark surrounding"
system prompt
"Sunny surrounding"
system prompt
No system prompt image Dark surrounding image Sunny surrounding image
Original prompt: a puppy in a pond, yarn art style
Code
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")
Downloads last month
50
Inference Examples
Examples
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for sayakpaul/trained-lumina2-lora-yarn

Adapter
(13)
this model