sdxl-isometric-geology LoRA by jakedahn

sdxl-isometric-geology is an SDXL fine-tune that's been trained with cool USGS isometric block and fence diagrams from the 1950s and 1960s.

lora_image

Inference with Replicate API

Grab your replicate token here

pip install replicate
export REPLICATE_API_TOKEN=r8_*************************************
import replicate

output = replicate.run(
    "sdxl-isometric-geology@sha256:44272e4bb4f61d052617d4b56cc5be7b34dc27d9605e4c9568efc215aae547c5",
    input={"prompt": "a diagram of gradient descent, in the style of TOK"}
)
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

Inference with 🧨 diffusers

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")

pipe.load_lora_weights("jakedahn/sdxl-isometric-geology", 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="jakedahn/sdxl-isometric-geology", filename="embeddings.pti", repo_type="model")
embhandler = TokenEmbeddingsHandler(text_encoders, tokenizers)
embhandler.load_embeddings(embedding_path)
prompt="a diagram of gradient descent, in the style of <s0><s1>"
images = pipe(
    prompt,
    cross_attention_kwargs={"scale": 0.8},
).images
#your output image
images[0]
Downloads last month
21
Inference Examples
Inference API (serverless) has been turned off for this model.

Model tree for jakedahn/sdxl-isometric-geology

Adapter
(5062)
this model

Spaces using jakedahn/sdxl-isometric-geology 18