Spaces:
Sleeping
Sleeping
Update anime_model.py
Browse files- anime_model.py +5 -2
anime_model.py
CHANGED
|
@@ -170,16 +170,19 @@ class Model:
|
|
| 170 |
#if num_images > MAX_NUM_IMAGES:
|
| 171 |
# raise ValueError
|
| 172 |
self.load("NormalBae")
|
|
|
|
|
|
|
|
|
|
| 173 |
control_image = self.preprocess(
|
| 174 |
image=image,
|
| 175 |
image_resolution=image_resolution,
|
| 176 |
detect_resolution=preprocess_resolution,
|
| 177 |
)
|
| 178 |
if prompt == "":
|
| 179 |
-
prompt = "anime
|
| 180 |
print(prompt)
|
| 181 |
return self.run_pipe(
|
| 182 |
-
prompt=self.get_prompt("Hentai
|
| 183 |
negative_prompt=negative_prompt,
|
| 184 |
control_image=control_image,
|
| 185 |
num_images=num_images,
|
|
|
|
| 170 |
#if num_images > MAX_NUM_IMAGES:
|
| 171 |
# raise ValueError
|
| 172 |
self.load("NormalBae")
|
| 173 |
+
model = NormalBaeDetector.from_pretrained(self.MODEL_ID)#.to("cuda")
|
| 174 |
+
torch.cuda.empty_cache()
|
| 175 |
+
gc.collect()
|
| 176 |
control_image = self.preprocess(
|
| 177 |
image=image,
|
| 178 |
image_resolution=image_resolution,
|
| 179 |
detect_resolution=preprocess_resolution,
|
| 180 |
)
|
| 181 |
if prompt == "":
|
| 182 |
+
prompt = "anime girl"
|
| 183 |
print(prompt)
|
| 184 |
return self.run_pipe(
|
| 185 |
+
prompt=self.get_prompt("Hentai Nude Anime Titties of " + prompt, additional_prompt),
|
| 186 |
negative_prompt=negative_prompt,
|
| 187 |
control_image=control_image,
|
| 188 |
num_images=num_images,
|