Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -43,21 +43,19 @@ bise_net = BiSeNet(n_classes = 19)
|
|
43 |
bise_net.load_state_dict(torch.load(bise_net_cp_path, map_location="cpu")) # device fail
|
44 |
bise_net.cuda()
|
45 |
|
46 |
-
import sys
|
47 |
-
sys.path.append("./models/LLaVA1.5/LLaVA/")
|
48 |
-
from llava_infer.model.builder import load_pretrained_model
|
49 |
-
from llava_infer.mm_utils import get_model_name_from_path
|
50 |
-
from llava_infer.eval.run_llava import eval_model
|
51 |
-
|
52 |
-
|
53 |
-
llva_model_path = "liuhaotian/llava-v1.5-7b"
|
54 |
-
llva_tokenizer, llva_model, llva_image_processor, llva_context_len = load_pretrained_model(
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
#
|
59 |
-
llva_model.to(device)
|
60 |
-
# llva_image_processor.to(device)
|
61 |
|
62 |
### Load consistentID_model checkpoint
|
63 |
pipe.load_ConsistentID_model(
|
@@ -124,7 +122,8 @@ def process(selected_template_images,costum_image,prompt
|
|
124 |
prompt = "A man, with backpack, in a raining tropical forest, adventuring, holding a flashlight, in mist, seeking animals"
|
125 |
prompt = "A person, in a sowm, wearing santa hat and a scarf, with a cottage behind"
|
126 |
else:
|
127 |
-
prompt=Enhance_prompt(prompt,Image.new('RGB', (200, 200), color = 'white'))
|
|
|
128 |
print(prompt)
|
129 |
pass
|
130 |
|
|
|
43 |
bise_net.load_state_dict(torch.load(bise_net_cp_path, map_location="cpu")) # device fail
|
44 |
bise_net.cuda()
|
45 |
|
46 |
+
# import sys
|
47 |
+
# sys.path.append("./models/LLaVA1.5/LLaVA/")
|
48 |
+
# from llava_infer.model.builder import load_pretrained_model
|
49 |
+
# from llava_infer.mm_utils import get_model_name_from_path
|
50 |
+
# from llava_infer.eval.run_llava import eval_model
|
51 |
+
|
52 |
+
### Load Llava for prompt enhancement
|
53 |
+
# llva_model_path = "liuhaotian/llava-v1.5-7b"
|
54 |
+
# llva_tokenizer, llva_model, llva_image_processor, llva_context_len = load_pretrained_model(
|
55 |
+
# model_path=llva_model_path,
|
56 |
+
# model_base=None,
|
57 |
+
# model_name=get_model_name_from_path(llva_model_path),)
|
58 |
+
# llva_model.to(device)
|
|
|
|
|
59 |
|
60 |
### Load consistentID_model checkpoint
|
61 |
pipe.load_ConsistentID_model(
|
|
|
122 |
prompt = "A man, with backpack, in a raining tropical forest, adventuring, holding a flashlight, in mist, seeking animals"
|
123 |
prompt = "A person, in a sowm, wearing santa hat and a scarf, with a cottage behind"
|
124 |
else:
|
125 |
+
# prompt=Enhance_prompt(prompt,Image.new('RGB', (200, 200), color = 'white'))
|
126 |
+
prompt = "cinematic photo," + prompt + ", 50mm photograph, half-length portrait, film, bokeh, professional, 4k, highly detailed"
|
127 |
print(prompt)
|
128 |
pass
|
129 |
|