This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
from pathlib import Path | |
from typing import Literal, List | |
import outlines | |
import torch | |
from PIL import Image | |
from pydantic import BaseModel, Field | |
from rich import print |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Visual Style Prompting with Swapping Self-Attention https://arxiv.org/pdf/2402.12974.pdf | |
# sdxl inversion repo: https://github.com/cloneofsimo/sdxl_inversions | |
# ( you might need to patch some stuff depending on your diffusers version) | |
# | |
from sdxl_inversions.pnp_pipeline import SDXLDDIMPipeline | |
import torch | |
pipe = SDXLDDIMPipeline.from_pretrained( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"customs": ["GOATbert", "STARKbert", "_1337bert", "ambert", "blobert", "blobhetti", "bobbyrealms", "breadbert", "bulbert", "butterbert", "calbert", "casbert", "chelbert", "credbert", "delbert", "devbert", "dombert", "duckbert", "erbert", "fombert", "francaisbert", "gobert", "goldbert", "grugbert", "guthbert", "hambert", "lanbert", "lootbert", "milbert", "mirbert", "moodbert", "nejbert", "neobert", "odbert", "pleurbert", "pobert", "raubert", "rebert", "redbert", "sebert", "shelbert", "squibert", "sylbert", "tarbert", "tbert", "tenbert", "udbert", "wenbert"], "backgrounds": ["Avnu Blue", "Blue", "Crypts and Caverns", "Fibrous Frame", "Green", "Holo", "Orange", "Purple", "Realms Dark", "Realms", "Terraforms", "Tulip"], "armours": ["Sheeps Wool", "Kigurumi", "Divine Robe Dark", "Divine Robe", "Dojo Robe", "Holy Chestplate", "Demon Husk", "Leather Armour", "Leopard Skin", "Linen Robe", "Lords Armor", "Secret Tattoo", "Chainmail", "Suit", "Underpants", "Wen Shirt", "Wsb Tank Top"], "jewelrys": ["Amulet", "Bronze R |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Raphael Vorias | |
# GL code adopted from: | |
# https://gist.github.com/victor-shepardson/3eb67c3664cde081a7e573376b1b0b54 | |
# Closed-form factorization adopted from: | |
# https://github.com/dvschultz | |
# This code is catered towards the stylegan2-ada-pytorch repo: | |
# https://github.com/NVlabs/stylegan2-ada-pytorch | |
# You can change it to other versions but you would need to edit main(), | |
# generate() and load_closed_form_fact(). |