Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ import datetime
|
|
24 |
app = FastAPI()
|
25 |
|
26 |
|
27 |
-
|
28 |
|
29 |
from tsr.system import TSR
|
30 |
from tsr.utils import remove_background, resize_foreground, to_gradio_3d_orientation
|
@@ -44,7 +44,7 @@ model = TSR.from_pretrained(
|
|
44 |
config_name="config.yaml",
|
45 |
weight_name="model.ckpt",
|
46 |
)
|
47 |
-
model.renderer.set_chunk_size(131072)
|
48 |
model.to(device)
|
49 |
|
50 |
rembg_session = rembg.new_session()
|
@@ -126,7 +126,7 @@ def gen_pos_prompt(text):
|
|
126 |
|
127 |
def generate_image_from_text(pos_prompt, seed):
|
128 |
new_prompt = gen_pos_prompt(pos_prompt)
|
129 |
-
print(new_prompt)
|
130 |
# neg_prompt = '''Detailed, complex textures, intricate patterns, realistic lighting, high contrast, reflections, fuzzy surface, realistic proportions, photographic quality, vibrant colors, detailed background, shadows, disfigured, deformed, ugly, multiple, duplicate.'''
|
131 |
# neg_prompt = '''Complex textures, intricate patterns, realistic lighting, high contrast, reflections, fuzzy surface, photographic quality, vibrant colors, detailed background, shadows, disfigured, deformed, ugly, multiple, duplicate.'''
|
132 |
neg_prompt = '''Complex patterns, realistic lighting, high contrast, reflections, fuzzy, photographic, vibrant, detailed, shadows, disfigured, duplicate.'''
|
@@ -137,8 +137,8 @@ def generate_image_from_text(pos_prompt, seed):
|
|
137 |
'negativeText': neg_prompt},
|
138 |
'imageGenerationConfig': {"cfgScale":8,
|
139 |
"seed":int(seed),
|
140 |
-
"width":
|
141 |
-
"height":
|
142 |
"numberOfImages":1
|
143 |
}
|
144 |
}
|
|
|
24 |
app = FastAPI()
|
25 |
|
26 |
|
27 |
+
subprocess.run(shlex.split('pip install wheel/torchmcubes-0.1.0-cp310-cp310-linux_x86_64.whl'))
|
28 |
|
29 |
from tsr.system import TSR
|
30 |
from tsr.utils import remove_background, resize_foreground, to_gradio_3d_orientation
|
|
|
44 |
config_name="config.yaml",
|
45 |
weight_name="model.ckpt",
|
46 |
)
|
47 |
+
# model.renderer.set_chunk_size(131072)
|
48 |
model.to(device)
|
49 |
|
50 |
rembg_session = rembg.new_session()
|
|
|
126 |
|
127 |
def generate_image_from_text(pos_prompt, seed):
|
128 |
new_prompt = gen_pos_prompt(pos_prompt)
|
129 |
+
# print(new_prompt)
|
130 |
# neg_prompt = '''Detailed, complex textures, intricate patterns, realistic lighting, high contrast, reflections, fuzzy surface, realistic proportions, photographic quality, vibrant colors, detailed background, shadows, disfigured, deformed, ugly, multiple, duplicate.'''
|
131 |
# neg_prompt = '''Complex textures, intricate patterns, realistic lighting, high contrast, reflections, fuzzy surface, photographic quality, vibrant colors, detailed background, shadows, disfigured, deformed, ugly, multiple, duplicate.'''
|
132 |
neg_prompt = '''Complex patterns, realistic lighting, high contrast, reflections, fuzzy, photographic, vibrant, detailed, shadows, disfigured, duplicate.'''
|
|
|
137 |
'negativeText': neg_prompt},
|
138 |
'imageGenerationConfig': {"cfgScale":8,
|
139 |
"seed":int(seed),
|
140 |
+
"width":512,
|
141 |
+
"height":512,
|
142 |
"numberOfImages":1
|
143 |
}
|
144 |
}
|