Spaces:
Build error
Build error
minor tweaks to ensure Try on works
Browse files- predict.py +3 -3
predict.py
CHANGED
|
@@ -19,8 +19,8 @@ class Predictor(BasePredictor):
|
|
| 19 |
hf_token: Secret = Input(description="Hugging Face API token. Create a write token at https://huggingface.co/settings/token. You also need to approve the Flux Dev terms."),
|
| 20 |
image: Path = Input(description="Image file path", default="https://github.com/nftblackmagic/catvton-flux/raw/main/example/person/1.jpg"),
|
| 21 |
mask: Path = Input(description="Mask file path", default="https://github.com/nftblackmagic/catvton-flux/blob/main/example/person/1_mask.png?raw=true"),
|
| 22 |
-
try_on: bool = Input(
|
| 23 |
-
garment: Path = Input(description="Garment file path
|
| 24 |
num_steps: int = Input(50, description="Number of steps to run the model for"),
|
| 25 |
guidance_scale: float = Input(30, description="Guidance scale for the model"),
|
| 26 |
seed: int = Input(0, description="Seed for the model"),
|
|
@@ -30,9 +30,9 @@ class Predictor(BasePredictor):
|
|
| 30 |
size = (width, height)
|
| 31 |
i = load_image(str(image)).convert("RGB").resize(size)
|
| 32 |
m = load_image(str(mask)).convert("RGB").resize(size)
|
| 33 |
-
g = load_image(str(garment)).convert("RGB").resize(size)
|
| 34 |
|
| 35 |
if try_on:
|
|
|
|
| 36 |
self.transformer = self.try_on_transformer
|
| 37 |
else:
|
| 38 |
self.transformer = self.try_off_transformer
|
|
|
|
| 19 |
hf_token: Secret = Input(description="Hugging Face API token. Create a write token at https://huggingface.co/settings/token. You also need to approve the Flux Dev terms."),
|
| 20 |
image: Path = Input(description="Image file path", default="https://github.com/nftblackmagic/catvton-flux/raw/main/example/person/1.jpg"),
|
| 21 |
mask: Path = Input(description="Mask file path", default="https://github.com/nftblackmagic/catvton-flux/blob/main/example/person/1_mask.png?raw=true"),
|
| 22 |
+
try_on: bool = Input(False, description="Try on or try off"),
|
| 23 |
+
garment: Path = Input(description="Garment file path like https://github.com/nftblackmagic/catvton-flux/raw/main/example/garment/00035_00.jpg", default=None),
|
| 24 |
num_steps: int = Input(50, description="Number of steps to run the model for"),
|
| 25 |
guidance_scale: float = Input(30, description="Guidance scale for the model"),
|
| 26 |
seed: int = Input(0, description="Seed for the model"),
|
|
|
|
| 30 |
size = (width, height)
|
| 31 |
i = load_image(str(image)).convert("RGB").resize(size)
|
| 32 |
m = load_image(str(mask)).convert("RGB").resize(size)
|
|
|
|
| 33 |
|
| 34 |
if try_on:
|
| 35 |
+
g = load_image(str(garment)).convert("RGB").resize(size)
|
| 36 |
self.transformer = self.try_on_transformer
|
| 37 |
else:
|
| 38 |
self.transformer = self.try_off_transformer
|