Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files- hg_app.py +5 -4
- hy3dgen/text2image.py +1 -1
hg_app.py
CHANGED
|
@@ -48,7 +48,7 @@ def get_example_txt_list():
|
|
| 48 |
return txt_list
|
| 49 |
|
| 50 |
|
| 51 |
-
def gen_save_folder(max_size=
|
| 52 |
os.makedirs(SAVE_DIR, exist_ok=True)
|
| 53 |
exists = set(int(_) for _ in os.listdir(SAVE_DIR) if not _.startswith("."))
|
| 54 |
cur_id = min(set(range(max_size)) - exists) if len(exists) < max_size else -1
|
|
@@ -152,8 +152,8 @@ def _gen_shape(
|
|
| 152 |
octree_resolution=octree_resolution
|
| 153 |
)[0]
|
| 154 |
|
| 155 |
-
mesh = FloaterRemover()(mesh)
|
| 156 |
-
mesh = DegenerateFaceRemover()(mesh)
|
| 157 |
mesh = FaceReducer()(mesh)
|
| 158 |
|
| 159 |
stats['number_of_faces'] = mesh.faces.shape[0]
|
|
@@ -164,7 +164,7 @@ def _gen_shape(
|
|
| 164 |
stats['time'] = time_meta
|
| 165 |
return mesh, save_folder
|
| 166 |
|
| 167 |
-
@spaces.GPU(duration=
|
| 168 |
def generation_all(
|
| 169 |
caption,
|
| 170 |
image,
|
|
@@ -412,5 +412,6 @@ if __name__ == '__main__':
|
|
| 412 |
app.mount("/static", StaticFiles(directory=static_dir), name="static")
|
| 413 |
|
| 414 |
demo = build_app()
|
|
|
|
| 415 |
app = gr.mount_gradio_app(app, demo, path="/")
|
| 416 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 48 |
return txt_list
|
| 49 |
|
| 50 |
|
| 51 |
+
def gen_save_folder(max_size=600):
|
| 52 |
os.makedirs(SAVE_DIR, exist_ok=True)
|
| 53 |
exists = set(int(_) for _ in os.listdir(SAVE_DIR) if not _.startswith("."))
|
| 54 |
cur_id = min(set(range(max_size)) - exists) if len(exists) < max_size else -1
|
|
|
|
| 152 |
octree_resolution=octree_resolution
|
| 153 |
)[0]
|
| 154 |
|
| 155 |
+
# mesh = FloaterRemover()(mesh)
|
| 156 |
+
# mesh = DegenerateFaceRemover()(mesh)
|
| 157 |
mesh = FaceReducer()(mesh)
|
| 158 |
|
| 159 |
stats['number_of_faces'] = mesh.faces.shape[0]
|
|
|
|
| 164 |
stats['time'] = time_meta
|
| 165 |
return mesh, save_folder
|
| 166 |
|
| 167 |
+
@spaces.GPU(duration=90)
|
| 168 |
def generation_all(
|
| 169 |
caption,
|
| 170 |
image,
|
|
|
|
| 412 |
app.mount("/static", StaticFiles(directory=static_dir), name="static")
|
| 413 |
|
| 414 |
demo = build_app()
|
| 415 |
+
demo.queue(max_size=3)
|
| 416 |
app = gr.mount_gradio_app(app, demo, path="/")
|
| 417 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
hy3dgen/text2image.py
CHANGED
|
@@ -82,7 +82,7 @@ class HunyuanDiTPipeline:
|
|
| 82 |
out_img = self.pipe(
|
| 83 |
prompt=self.pos_txt+prompt,
|
| 84 |
negative_prompt=self.neg_txt,
|
| 85 |
-
num_inference_steps=
|
| 86 |
pag_scale=1.3,
|
| 87 |
width=1024,
|
| 88 |
height=1024,
|
|
|
|
| 82 |
out_img = self.pipe(
|
| 83 |
prompt=self.pos_txt+prompt,
|
| 84 |
negative_prompt=self.neg_txt,
|
| 85 |
+
num_inference_steps=20,
|
| 86 |
pag_scale=1.3,
|
| 87 |
width=1024,
|
| 88 |
height=1024,
|