svjack's picture
Update README.md
31b72d4 verified

Installtion

sudo apt-get update && sudo apt-get install git-lfs ffmpeg cbm

conda create --name py310 python=3.10
conda activate py310
pip install ipykernel
python -m ipykernel install --user --name py310 --display-name "py310"

pip install diffusers torch torchvision moviepy==1.0.3 omegaconf compel transformers peft safetensors datasets tabulate
git clone https://huggingface.co./svjack/Star_Rail_Tribbie_Lora

Inference

from compel import Compel, ReturnedEmbeddingsType
from diffusers import DiffusionPipeline, StableDiffusionXLPipeline
import torch

# Initialize the DiffusionPipeline with SDXL
pipeline = StableDiffusionXLPipeline.from_single_file(
    "Star_Rail_Tribbie_Lora/waiNSFWIllustrious_v110.safetensors",
    torch_dtype=torch.float16
)
pipeline.enable_model_cpu_offload()

# Step 4: Load the LoRA adapter
pipeline.load_lora_weights("Star_Rail_Tribbie_Lora/tribbie.il.safetensors")

# Initialize Compel for SDXL
compel = Compel(
    tokenizer=[pipeline.tokenizer, pipeline.tokenizer_2],
    text_encoder=[pipeline.text_encoder, pipeline.text_encoder_2],
    returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED,
    requires_pooled=[False, True],
    truncate_long_prompts=False,
)

prompt = "1girl ,detailed background, posing, <lora:tribbie.il:1> tribbie, cross-shaped_pupils , one eye closed, missile,"
prompt = "1girl, detailed background, posing,  <lora:tribbie.il:1>, tribbie, cross-shaped_pupils, one eye closed, holding a cup of coffee, relaxed atmosphere, cozy cafe setting, warm lighting, steam rising from the coffee cup, soft smile, casual outfit, sitting by a window, outside view of a peaceful street, plants in the background, soft focus on the background to emphasize the character."
prompt = "detailed background, shiny skin, posing, <lora:tribbie.il:1> tribbie, 3girls, eye patch, hair over eye,"

# Generate conditioning tensors
conditioning, pooled = compel(prompt)

# Generate the image
image = pipeline(
    prompt_embeds=conditioning,
    pooled_prompt_embeds=pooled,
    num_inference_steps=30
).images[0]

# Save the image
image.save("tribbie_image.jpg")

# Display the image
from IPython import display
display.Image("tribbie_image.jpg", width=512, height=512)

Demo

  • 1girl ,detailed background, posing, lora:tribbie.il:1 tribbie, cross-shaped_pupils , one eye closed, missile,

image/jpeg

image/jpeg

  • 1girl, detailed background, posing, lora:tribbie.il:1, tribbie, cross-shaped_pupils, one eye closed, holding a cup of coffee, relaxed atmosphere, cozy cafe setting, warm lighting, steam rising from the coffee cup, soft smile, casual outfit, sitting by a window, outside view of a peaceful street, plants in the background, soft focus on the background to emphasize the character.

image/jpeg

image/jpeg

  • detailed background, shiny skin, posing, lora:tribbie.il:1 tribbie, 3girls, eye patch, hair over eye,

image/jpeg

python produce_tribbie_dataset.py