T

Diffusers
Safetensors
T
File size: 255 Bytes
964f845
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from contextlib import contextmanager

_IP_TOK = None

@contextmanager
def ip_tokens_context(x):
    global _IP_TOK
    old = _IP_TOK
    _IP_TOK = x
    try:
        yield
    finally:
        _IP_TOK = old

def current_ip_tokens():
    return _IP_TOK