Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -146,10 +146,16 @@ def start_tryon(dict, garm_img, garment_des, is_checked, is_checked_crop, denois
|
|
| 146 |
|
| 147 |
with torch.no_grad():
|
| 148 |
with torch.cuda.amp.autocast():
|
|
|
|
|
|
|
|
|
|
| 149 |
prompt = "model is wearing " + garment_des
|
| 150 |
negative_prompt = "monochrome, lowres, bad anatomy, worst quality, low quality"
|
| 151 |
-
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
prompt_c = "a photo of " + garment_des
|
| 155 |
prompt_embeds_c, _, _, _ = pipe.encode_prompt(
|
|
|
|
| 146 |
|
| 147 |
with torch.no_grad():
|
| 148 |
with torch.cuda.amp.autocast():
|
| 149 |
+
if not garment_des or not isinstance(garment_des, str):
|
| 150 |
+
garment_des = "a garment"
|
| 151 |
+
|
| 152 |
prompt = "model is wearing " + garment_des
|
| 153 |
negative_prompt = "monochrome, lowres, bad anatomy, worst quality, low quality"
|
| 154 |
+
|
| 155 |
+
if not garment_des or not isinstance(garment_des, str):
|
| 156 |
+
garment_des = "a garment"
|
| 157 |
+
|
| 158 |
+
prompt_embeds, neg_embeds, pooled_prompt_embeds, neg_pooled_prompt_embeds = pipe.encode_prompt([prompt], 1, True, [negative_prompt])
|
| 159 |
|
| 160 |
prompt_c = "a photo of " + garment_des
|
| 161 |
prompt_embeds_c, _, _, _ = pipe.encode_prompt(
|