Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import os
|
|
3 |
import random
|
4 |
import uuid
|
5 |
import gradio as gr
|
|
|
6 |
import numpy as np
|
7 |
import uuid
|
8 |
from diffusers import PixArtAlphaPipeline, LCMScheduler
|
@@ -105,12 +106,6 @@ if torch.cuda.is_available():
|
|
105 |
print("Using DALL-E 3 Consistency Decoder")
|
106 |
pipe.vae = ConsistencyDecoderVAE.from_pretrained("openai/consistency-decoder", torch_dtype=torch.float16)
|
107 |
|
108 |
-
if ENABLE_CPU_OFFLOAD:
|
109 |
-
pipe.enable_model_cpu_offload()
|
110 |
-
else:
|
111 |
-
pipe.to(device)
|
112 |
-
print("Loaded on Device!")
|
113 |
-
|
114 |
# speed-up T5
|
115 |
pipe.text_encoder.to_bettertransformer()
|
116 |
|
|
|
3 |
import random
|
4 |
import uuid
|
5 |
import gradio as gr
|
6 |
+
import space
|
7 |
import numpy as np
|
8 |
import uuid
|
9 |
from diffusers import PixArtAlphaPipeline, LCMScheduler
|
|
|
106 |
print("Using DALL-E 3 Consistency Decoder")
|
107 |
pipe.vae = ConsistencyDecoderVAE.from_pretrained("openai/consistency-decoder", torch_dtype=torch.float16)
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
# speed-up T5
|
110 |
pipe.text_encoder.to_bettertransformer()
|
111 |
|