Views
No views yet
trained-lumina2-lora-yarn DreamBooth LoRA weights for Alpha-VLLM/Lumina-Image-2.0.yarn art style to trigger the image generation.system_prompt was also used used during training (ignore if None): None.1import torch
2from diffusers import Lumina2Text2ImgPipeline
3
4pipe = Lumina2Text2ImgPipeline.from_pretrained(
5 "Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16
6).to("cuda")
7
8pipe.load_lora_weights("trained-lumina2-lora-yarn")
9prompt = "a puppy in a pond, yarn art style"
10
11image = pipe(
12 prompt,
13 negative_prompt="bad quality, worse quality, degenerate quality",
14 guidance_scale=6,
15 num_inference_steps=35,
16 generator=torch.manual_seed(0)
17).images[0]system_prompt. Here is a comparison across different system prompts:| No system prompt | "Dark surrounding" system prompt | "Sunny surrounding" system prompt |
|---|---|---|
![]() | ![]() | ![]() |
|
Original prompt: a puppy in a pond, yarn art style
|
1import torch
2from diffusers import Lumina2Text2ImgPipeline
3
4pipe = Lumina2Text2ImgPipeline.from_pretrained(
5 "Alpha-VLLM/Lumina-Image-2.0", torch_dtype=torch.bfloat16
6).to("cuda")
7
8
9system_prompts = [
10 None,
11 "You are an assistant designed to generate superior images with a dark overall theme.",
12 "You are an assistant designed to generate superior images with a bright and shiny overall theme."
13]
14
15pipe.load_lora_weights("trained-lumina2-lora-yarn")
16prompt = "a puppy in a pond, yarn art style"
17
18for sp in system_prompts:
19 filename = "yarn_lora"
20 image = pipe(
21 prompt,
22 negative_prompt="bad quality, worse quality, degenerate quality",
23 system_prompt=sp,
24 guidance_scale=6,
25 num_inference_steps=35,
26 generator=torch.manual_seed(0)
27 ).images[0]
28 if sp:
29 filename += "_" + "_".join(sp.split(" ")).replace(",", "").replace(".", "")
30 filename = filename[:100]
31
32 image.save(f"{filename}.png")
33