Update app.py
Browse files
app.py
CHANGED
|
@@ -13,26 +13,54 @@ os.environ["HF_HUB_DISABLE_TELEMETRY"] = "1"
|
|
| 13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 14 |
torch_dtype = torch.float16
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
MODEL_OPTIONS = {
|
| 17 |
-
|
| 18 |
-
"
|
| 19 |
-
"
|
| 20 |
-
|
| 21 |
-
"SiD-Flow-SD3.5-
|
| 22 |
-
"SiDA-Flow-SD3.5-
|
| 23 |
-
"SiD-Flow-
|
| 24 |
-
"SiDA-Flow-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
"SiD-Flow-Sana-
|
| 28 |
-
"SiDA-Flow-Sana-
|
| 29 |
-
"SiD-Flow-Sana-
|
| 30 |
-
"SiDA-Flow-Sana-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
}
|
| 34 |
|
| 35 |
|
|
|
|
| 36 |
def load_model(model_choice, progress=None):
|
| 37 |
if progress is not None:
|
| 38 |
progress(0.1, desc=f"Loading {model_choice}...")
|
|
|
|
| 13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 14 |
torch_dtype = torch.float16
|
| 15 |
|
| 16 |
+
# MODEL_OPTIONS = {
|
| 17 |
+
# "SiD-Flow-SD3-medium": "YGu1998/SiD-Flow-SD3-medium",
|
| 18 |
+
# "SiDA-Flow-SD3-medium": "YGu1998/SiDA-Flow-SD3-medium",
|
| 19 |
+
# "SiD-Flow-SD3.5-medium": "YGu1998/SiD-Flow-SD3.5-medium",
|
| 20 |
+
# "SiDA-Flow-SD3.5-medium": "YGu1998/SiDA-Flow-SD3.5-medium",
|
| 21 |
+
# "SiD-Flow-SD3.5-large": "YGu1998/SiD-Flow-SD3.5-large",
|
| 22 |
+
# "SiDA-Flow-SD3.5-large": "YGu1998/SiDA-Flow-SD3.5-large",
|
| 23 |
+
# "SiD-Flow-Sana-0.6B-512-res": "YGu1998/SiD-Flow-Sana-0.6B-512-res",
|
| 24 |
+
# "SiDA-Flow-Sana-0.6B-512-res": "YGu1998/SiDA-Flow-Sana-0.6B-512-res",
|
| 25 |
+
# "SiD-Flow-Sana-1.6B-512-res": "YGu1998/SiD-Flow-Sana-1.6B-512-res",
|
| 26 |
+
# "SiDA-Flow-Sana-1.6B-512-res": "YGu1998/SiDA-Flow-Sana-1.6B-512-res",
|
| 27 |
+
# "SiD-Flow-Sana-Sprint-0.6B-1024-res": "YGu1998/SiD-Flow-Sana-Sprint-0.6B-1024-res",
|
| 28 |
+
# "SiDA-Flow-Sana-Sprint-0.6B-1024-res": "YGu1998/SiDA-Flow-Sana-Sprint-0.6B-1024-res",
|
| 29 |
+
# "SiD-Flow-Sana-Sprint-1.6B-1024-res": "YGu1998/SiD-Flow-Sana-Sprint-1.6B-1024-res",
|
| 30 |
+
# "SiDA-Flow-Sana-Sprint-1.6B-1024-res": "YGu1998/SiDA-Flow-Sana-Sprint-1.6B-1024-res",
|
| 31 |
+
# "SiD-Flow-Flux-1024-res": "YGu1998/SiD-Flow-Flux-1024-res",
|
| 32 |
+
# "SiD-Flow-Flux-512-res": "YGu1998/SiD-Flow-Flux-512-res",
|
| 33 |
+
# }
|
| 34 |
+
|
| 35 |
MODEL_OPTIONS = {
|
| 36 |
+
# SD3 / SD3.5
|
| 37 |
+
"SiD-Flow-SD3-medium": "YGu1998/SiD-DiT-SD3-medium",
|
| 38 |
+
"SiDA-Flow-SD3-medium": "YGu1998/SiD-alpha-DiT-SD3-medium",
|
| 39 |
+
|
| 40 |
+
"SiD-Flow-SD3.5-medium": "YGu1998/SiD-DiT-SD3.5-medium",
|
| 41 |
+
"SiDA-Flow-SD3.5-medium": "YGu1998/SiD-alpha-DiT-SD3.5-medium",
|
| 42 |
+
"SiD-Flow-SD3.5-large": "YGu1998/SiD-DiT-SD3.5-large",
|
| 43 |
+
"SiDA-Flow-SD3.5-large": "YGu1998/SiD-alpha-DiT-SD3.5-large",
|
| 44 |
+
|
| 45 |
+
# SANA rectified-flow (non-Sprint)
|
| 46 |
+
"SiD-Flow-Sana-0.6B-512-res": "YGu1998/SiD-DiT-SANA-0.6B-RectifiedFlow",
|
| 47 |
+
"SiDA-Flow-Sana-0.6B-512-res": "YGu1998/SiD-alpha-DiT-SANA-0.6B-RectifiedFlow",
|
| 48 |
+
"SiD-Flow-Sana-1.6B-512-res": "YGu1998/SiD-DiT-SANA-1.6B-RectifiedFlow",
|
| 49 |
+
"SiDA-Flow-Sana-1.6B-512-res": "YGu1998/SiD-alpha-DiT-SANA-1.6B-RectifiedFlow",
|
| 50 |
+
|
| 51 |
+
# SANA Sprint (TrigFlow)
|
| 52 |
+
"SiD-Flow-Sana-Sprint-0.6B-1024-res": "YGu1998/SiD-DiT-SANA-0.6B-TrigFlow",
|
| 53 |
+
"SiDA-Flow-Sana-Sprint-0.6B-1024-res": "YGu1998/SiD-alpha-DiT-SANA-0.6B-TrigFlow",
|
| 54 |
+
"SiD-Flow-Sana-Sprint-1.6B-1024-res": "YGu1998/SiD-DiT-SANA-1.6B-TrigFlow",
|
| 55 |
+
"SiDA-Flow-Sana-Sprint-1.6B-1024-res": "YGu1998/SiD-alpha-DiT-SANA-1.6B-TrigFlow",
|
| 56 |
+
|
| 57 |
+
# FLUX
|
| 58 |
+
"SiD-Flow-Flux-1024-res": "YGu1998/SiD-DiT-Flux-1024-res",
|
| 59 |
+
"SiD-Flow-Flux-512-res": "YGu1998/SiD-DiT-Flux-512-res",
|
| 60 |
}
|
| 61 |
|
| 62 |
|
| 63 |
+
|
| 64 |
def load_model(model_choice, progress=None):
|
| 65 |
if progress is not None:
|
| 66 |
progress(0.1, desc=f"Loading {model_choice}...")
|