Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,7 @@ from live_preview_helpers import calculate_shift, retrieve_timesteps, flux_pipe_
|
|
| 16 |
from huggingface_hub import HfFileSystem, ModelCard
|
| 17 |
from safetensors.torch import load_file
|
| 18 |
from huggingface_hub import login
|
|
|
|
| 19 |
|
| 20 |
hf_token = os.environ.get("HF_TOKEN")
|
| 21 |
login(token=hf_token)
|
|
@@ -47,7 +48,10 @@ pipe.tokenizer = clip_processor.tokenizer
|
|
| 47 |
pipe.text_encoder = clip_model.text_model
|
| 48 |
pipe.tokenizer_max_length = 248
|
| 49 |
pipe.text_encoder.dtype = torch.bfloat16
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
MAX_SEED = 2**32-1
|
| 52 |
|
| 53 |
class calculateDuration:
|
|
|
|
| 16 |
from huggingface_hub import HfFileSystem, ModelCard
|
| 17 |
from safetensors.torch import load_file
|
| 18 |
from huggingface_hub import login
|
| 19 |
+
from pathlib import Path
|
| 20 |
|
| 21 |
hf_token = os.environ.get("HF_TOKEN")
|
| 22 |
login(token=hf_token)
|
|
|
|
| 48 |
pipe.text_encoder = clip_model.text_model
|
| 49 |
pipe.tokenizer_max_length = 248
|
| 50 |
pipe.text_encoder.dtype = torch.bfloat16
|
| 51 |
+
|
| 52 |
+
pipe.transformer.enable_layerwise_casting(
|
| 53 |
+
storage_dtype=torch.float8_e4m3fn, compute_dtype=torch.bfloat16
|
| 54 |
+
)
|
| 55 |
MAX_SEED = 2**32-1
|
| 56 |
|
| 57 |
class calculateDuration:
|