Downloads · 30 days
7
1% of all-time downloads
areshi/sdxl-mk1
sdxl-mk1 is a text-to-image model from areshi. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as creativeml-openrail-m.
Downloads · 30 days
7
1% of all-time downloads
All-time downloads
635
Public
Repo size
186 MB
Likes
0
Public
Click a slice to open those files.
.safetensors186 MB · 100%
From the Hugging Face model README

Grab your replicate token here
pip install replicate
export REPLICATE_API_TOKEN=r8_*************************************
import replicate
output = replicate.run(
"sdxl-mk1@sha256:7ad4307597a51cbe61a568e835f8f475d33b97b0987117c5a89cbf0e699eb69c",
input={"prompt": "In the style of MK1, scorpion in the style of a dark and mysterious ninja costume, black and misty details, fiery eyes and hands, skull as his head"}
)
print(output)
You may also do inference via the API with Node.js or curl, and locally with COG and Docker, check out the Replicate API page for this model
Replicate SDXL LoRAs are trained with Pivotal Tuning, which combines training a concept via Dreambooth LoRA with training a new token with Textual Inversion.
As diffusers doesn't yet support textual inversion for SDXL, we will use cog-sdxl TokenEmbeddingsHandler class.
The trigger tokens for your prompt will be <s0><s1>
pip install diffusers transformers accelerate safetensors huggingface_hub
git clone https://github.com/replicate/cog-sdxl cog_sdxl
import torch
from huggingface_hub import hf_hub_download
from diffusers import DiffusionPipeline
from cog_sdxl.dataset_and_utils import TokenEmbeddingsHandler
from diffusers.models import AutoencoderKL
pipe = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16,
variant="fp16",
).to("cuda")
load_lora_weights("areshi/sdxl-mk1", weight_name="lora.safetensors")
text_encoders = [pipe.text_encoder, pipe.text_encoder_2]
tokenizers = [pipe.tokenizer, pipe.tokenizer_2]
embedding_path = hf_hub_download(repo_id="areshi/sdxl-mk1", filename="embeddings.pti", repo_type="model")
embhandler = TokenEmbeddingsHandler(text_encoders, tokenizers)
embhandler.load_embeddings(embedding_path)
prompt="In the style of MK1, scorpion in the style of a dark and mysterious ninja costume, black and misty details, fiery eyes and hands, skull as his head"
images = pipe(
prompt,
cross_attention_kwargs={"scale": 0.8},
).images
#your output image
images[0]