Skip to content

Instantly share code, notes, and snippets.

View rvorias's full-sized avatar

dham rvorias

View GitHub Profile
@rvorias
rvorias / outlines_qwen.py
Created October 30, 2024 12:53
qwen structured json output + fewshot
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
@rvorias
rvorias / ddimi_style_xl.py
Last active February 28, 2024 11:53
hacky script for getting Visual Style Prompting to work on arbitrary images with DDIMInverse
#
# 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(
@rvorias
rvorias / data.json
Last active February 23, 2024 12:31
blobert_data
{"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
@rvorias
rvorias / shader_yielding_stylegan.py
Last active May 5, 2022 07:50
You can run this gist in order to interact with your stylegan2adaPT model in real time.
# 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().