Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ if not torch.cuda.is_available():
|
|
22 |
MAX_SEED = np.iinfo(np.int32).max
|
23 |
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "1") == "1"
|
24 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4192"))
|
25 |
-
USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "
|
26 |
ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
|
27 |
|
28 |
style_list = [
|
@@ -79,8 +79,6 @@ pipe = PixArtAlphaPipeline.from_pretrained(
|
|
79 |
torch_dtype=torch.float16,
|
80 |
use_safetensors=True,
|
81 |
).to("cuda:0")
|
82 |
-
quantize(pipe.transformer, weights=qfloat8)
|
83 |
-
freeze(pipe.transformer)
|
84 |
|
85 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
86 |
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|
|
|
22 |
MAX_SEED = np.iinfo(np.int32).max
|
23 |
CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "1") == "1"
|
24 |
MAX_IMAGE_SIZE = int(os.getenv("MAX_IMAGE_SIZE", "4192"))
|
25 |
+
USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "1") == "1"
|
26 |
ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
|
27 |
|
28 |
style_list = [
|
|
|
79 |
torch_dtype=torch.float16,
|
80 |
use_safetensors=True,
|
81 |
).to("cuda:0")
|
|
|
|
|
82 |
|
83 |
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
|
84 |
p, n = styles.get(style_name, styles[DEFAULT_STYLE_NAME])
|