Skip to content

Instantly share code, notes, and snippets.

View cloneofsimo's full-sized avatar

Simo Ryu cloneofsimo

View GitHub Profile
@cloneofsimo
cloneofsimo / prompt_rewight.py
Last active September 13, 2023 11:01
Prompt Reweighting
from diffusers import DiffusionPipeline
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import torch
import re
MODEL_CACHE = "./cache"
def split_by_emphasis(text, tokenizer, normalize = True):