Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
0c23f7f
1
Parent(s):
776de3e
app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ import os
|
|
| 7 |
import time
|
| 8 |
|
| 9 |
from utils.utils import load_cn_model, load_cn_config, load_tagger_model, load_lora_model, resize_image_aspect_ratio, base_generation
|
| 10 |
-
from utils.prompt_utils import remove_color
|
| 11 |
from utils.tagger import modelLoad, analysis
|
| 12 |
|
| 13 |
|
|
@@ -54,6 +54,11 @@ def predict(input_image_path, prompt, negative_prompt, controlnet_scale):
|
|
| 54 |
white_base_pil = base_generation(resize_image.size, (255, 255, 255, 255)).convert("RGB")
|
| 55 |
generator = torch.manual_seed(0)
|
| 56 |
last_time = time.time()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
output_image = pipe(
|
| 59 |
image=white_base_pil,
|
|
|
|
| 7 |
import time
|
| 8 |
|
| 9 |
from utils.utils import load_cn_model, load_cn_config, load_tagger_model, load_lora_model, resize_image_aspect_ratio, base_generation
|
| 10 |
+
from utils.prompt_utils import execute_prompt, remove_color, remove_duplicates
|
| 11 |
from utils.tagger import modelLoad, analysis
|
| 12 |
|
| 13 |
|
|
|
|
| 54 |
white_base_pil = base_generation(resize_image.size, (255, 255, 255, 255)).convert("RGB")
|
| 55 |
generator = torch.manual_seed(0)
|
| 56 |
last_time = time.time()
|
| 57 |
+
prompt = "masterpiece, best quality, monochrome, lineart, white background, " + prompt
|
| 58 |
+
execute_tags = ["sketch", "transparent background"]
|
| 59 |
+
prompt = execute_prompt(execute_tags, prompt)
|
| 60 |
+
prompt = remove_duplicates(prompt)
|
| 61 |
+
prompt = remove_color(prompt)
|
| 62 |
|
| 63 |
output_image = pipe(
|
| 64 |
image=white_base_pil,
|