Spaces:
Sleeping
Sleeping
:tada: add external model
Browse files
app.py
CHANGED
@@ -11,11 +11,11 @@ DIFFUSERS_MODEL_IDS = [
|
|
11 |
"runwayml/stable-diffusion-v1-5",
|
12 |
]
|
13 |
|
14 |
-
|
15 |
-
"Beautiful Realistic Asians": "
|
16 |
}
|
17 |
|
18 |
-
MODEL_CHOICES = DIFFUSERS_MODEL_IDS + list(
|
19 |
|
20 |
# Global Variables
|
21 |
current_model_id = "stabilityai/stable-diffusion-3-medium-diffusers"
|
@@ -43,6 +43,9 @@ def inference(
|
|
43 |
|
44 |
if model_id != current_model_id:
|
45 |
try:
|
|
|
|
|
|
|
46 |
pipe = DiffusionPipeline.from_pretrained(
|
47 |
model_id,
|
48 |
torch_dtype=torch.float16,
|
|
|
11 |
"runwayml/stable-diffusion-v1-5",
|
12 |
]
|
13 |
|
14 |
+
EXTERNAL_MODEL_MAPPING = {
|
15 |
+
"Beautiful Realistic Asians": "checkpoints/diffusers/Beautiful Realistic Asians v7",
|
16 |
}
|
17 |
|
18 |
+
MODEL_CHOICES = DIFFUSERS_MODEL_IDS + list(EXTERNAL_MODEL_MAPPING.keys())
|
19 |
|
20 |
# Global Variables
|
21 |
current_model_id = "stabilityai/stable-diffusion-3-medium-diffusers"
|
|
|
43 |
|
44 |
if model_id != current_model_id:
|
45 |
try:
|
46 |
+
if model_id not in DIFFUSERS_MODEL_IDS:
|
47 |
+
model_id = EXTERNAL_MODEL_MAPPING[model_id]
|
48 |
+
|
49 |
pipe = DiffusionPipeline.from_pretrained(
|
50 |
model_id,
|
51 |
torch_dtype=torch.float16,
|