Spaces:
Running
on
Zero
Running
on
Zero
update model
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- app.py +10 -6
- trellis/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/models/__init__.py +2 -1
- trellis/models/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/models/__pycache__/sparse_structure_flow.cpython-310.pyc +0 -0
- trellis/models/__pycache__/sparse_structure_vae.cpython-310.pyc +0 -0
- trellis/models/__pycache__/structured_latent_flow.cpython-310.pyc +0 -0
- trellis/models/structured_latent_flow.py +65 -9
- trellis/models/structured_latent_vae/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/models/structured_latent_vae/__pycache__/base.cpython-310.pyc +0 -0
- trellis/models/structured_latent_vae/__pycache__/decoder_gs.cpython-310.pyc +0 -0
- trellis/models/structured_latent_vae/__pycache__/decoder_mesh.cpython-310.pyc +0 -0
- trellis/models/structured_latent_vae/__pycache__/encoder.cpython-310.pyc +0 -0
- trellis/modules/__pycache__/norm.cpython-310.pyc +0 -0
- trellis/modules/__pycache__/spatial.cpython-310.pyc +0 -0
- trellis/modules/__pycache__/utils.cpython-310.pyc +0 -0
- trellis/modules/attention/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/modules/attention/__pycache__/full_attn.cpython-310.pyc +0 -0
- trellis/modules/attention/__pycache__/modules.cpython-310.pyc +0 -0
- trellis/modules/sparse/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/modules/sparse/__pycache__/basic.cpython-310.pyc +0 -0
- trellis/modules/sparse/__pycache__/linear.cpython-310.pyc +0 -0
- trellis/modules/sparse/__pycache__/nonlinearity.cpython-310.pyc +0 -0
- trellis/modules/sparse/__pycache__/norm.cpython-310.pyc +0 -0
- trellis/modules/sparse/__pycache__/spatial.cpython-310.pyc +0 -0
- trellis/modules/sparse/attention/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/modules/sparse/attention/__pycache__/full_attn.cpython-310.pyc +0 -0
- trellis/modules/sparse/attention/__pycache__/modules.cpython-310.pyc +0 -0
- trellis/modules/sparse/attention/__pycache__/serialized_attn.cpython-310.pyc +0 -0
- trellis/modules/sparse/attention/__pycache__/windowed_attn.cpython-310.pyc +0 -0
- trellis/modules/sparse/conv/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/modules/sparse/conv/__pycache__/conv_spconv.cpython-310.pyc +0 -0
- trellis/modules/sparse/transformer/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/modules/sparse/transformer/__pycache__/blocks.cpython-310.pyc +0 -0
- trellis/modules/sparse/transformer/__pycache__/modulated.cpython-310.pyc +0 -0
- trellis/modules/sparse/transformer/modulated.py +8 -2
- trellis/modules/transformer/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/modules/transformer/__pycache__/blocks.cpython-310.pyc +0 -0
- trellis/modules/transformer/__pycache__/modulated.cpython-310.pyc +0 -0
- trellis/modules/transformer/modulated.py +8 -3
- trellis/pipelines/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/pipelines/__pycache__/base.cpython-310.pyc +0 -0
- trellis/pipelines/__pycache__/trellis_image_to_3d.cpython-310.pyc +0 -0
- trellis/pipelines/base.py +3 -0
- trellis/pipelines/samplers/__pycache__/__init__.cpython-310.pyc +0 -0
- trellis/pipelines/samplers/__pycache__/base.cpython-310.pyc +0 -0
- trellis/pipelines/samplers/__pycache__/classifier_free_guidance_mixin.cpython-310.pyc +0 -0
- trellis/pipelines/samplers/__pycache__/flow_euler.cpython-310.pyc +0 -0
- trellis/pipelines/samplers/__pycache__/flow_euler_old.cpython-310.pyc +0 -0
- trellis/pipelines/samplers/__pycache__/guidance_interval_mixin.cpython-310.pyc +0 -0
app.py
CHANGED
|
@@ -193,7 +193,7 @@ def generate_and_extract_glb(
|
|
| 193 |
image_files = [image[0] for image in multiimages]
|
| 194 |
|
| 195 |
# Generate 3D model
|
| 196 |
-
outputs = pipeline.run(
|
| 197 |
image=image_files,
|
| 198 |
seed=seed,
|
| 199 |
formats=["gaussian", "mesh"],
|
|
@@ -210,6 +210,12 @@ def generate_and_extract_glb(
|
|
| 210 |
)
|
| 211 |
|
| 212 |
# Render video
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
video = render_utils.render_video(outputs['gaussian'][0], num_frames=120)['color']
|
| 214 |
video_geo = render_utils.render_video(outputs['mesh'][0], num_frames=120)['normal']
|
| 215 |
video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]
|
|
@@ -331,10 +337,8 @@ with demo:
|
|
| 331 |
image_prompt = gr.Image(label="Image Prompt", format="png", visible=False, image_mode="RGBA", type="pil", height=300)
|
| 332 |
multiimage_prompt = gr.Gallery(label="Image Prompt", format="png", type="pil", height=300, columns=3)
|
| 333 |
gr.Markdown("""
|
| 334 |
-
Input different views of the object in separate images.
|
| 335 |
-
|
| 336 |
-
*NOTE: this is an experimental algorithm without training a specialized model. It may not produce the best results for all images, especially those having different poses or inconsistent details.*
|
| 337 |
-
""")
|
| 338 |
|
| 339 |
with gr.Accordion(label="Generation Settings", open=False):
|
| 340 |
seed = gr.Slider(0, MAX_SEED, label="Seed", value=0, step=1)
|
|
@@ -434,7 +438,7 @@ with demo:
|
|
| 434 |
|
| 435 |
# Launch the Gradio app
|
| 436 |
if __name__ == "__main__":
|
| 437 |
-
pipeline = TrellisVGGTTo3DPipeline.from_pretrained("Stable-X/trellis-vggt-v0-
|
| 438 |
pipeline.cuda()
|
| 439 |
pipeline.VGGT_model.cuda()
|
| 440 |
pipeline.birefnet_model.cuda()
|
|
|
|
| 193 |
image_files = [image[0] for image in multiimages]
|
| 194 |
|
| 195 |
# Generate 3D model
|
| 196 |
+
outputs, _, _ = pipeline.run(
|
| 197 |
image=image_files,
|
| 198 |
seed=seed,
|
| 199 |
formats=["gaussian", "mesh"],
|
|
|
|
| 210 |
)
|
| 211 |
|
| 212 |
# Render video
|
| 213 |
+
# import uuid
|
| 214 |
+
# output_id = str(uuid.uuid4())
|
| 215 |
+
# os.makedirs(f"{TMP_DIR}/{output_id}", exist_ok=True)
|
| 216 |
+
# video_path = f"{TMP_DIR}/{output_id}/preview.mp4"
|
| 217 |
+
# glb_path = f"{TMP_DIR}/{output_id}/mesh.glb"
|
| 218 |
+
|
| 219 |
video = render_utils.render_video(outputs['gaussian'][0], num_frames=120)['color']
|
| 220 |
video_geo = render_utils.render_video(outputs['mesh'][0], num_frames=120)['normal']
|
| 221 |
video = [np.concatenate([video[i], video_geo[i]], axis=1) for i in range(len(video))]
|
|
|
|
| 337 |
image_prompt = gr.Image(label="Image Prompt", format="png", visible=False, image_mode="RGBA", type="pil", height=300)
|
| 338 |
multiimage_prompt = gr.Gallery(label="Image Prompt", format="png", type="pil", height=300, columns=3)
|
| 339 |
gr.Markdown("""
|
| 340 |
+
Input different views of the object in separate images.
|
| 341 |
+
""")
|
|
|
|
|
|
|
| 342 |
|
| 343 |
with gr.Accordion(label="Generation Settings", open=False):
|
| 344 |
seed = gr.Slider(0, MAX_SEED, label="Seed", value=0, step=1)
|
|
|
|
| 438 |
|
| 439 |
# Launch the Gradio app
|
| 440 |
if __name__ == "__main__":
|
| 441 |
+
pipeline = TrellisVGGTTo3DPipeline.from_pretrained("Stable-X/trellis-vggt-v0-2")
|
| 442 |
pipeline.cuda()
|
| 443 |
pipeline.VGGT_model.cuda()
|
| 444 |
pipeline.birefnet_model.cuda()
|
trellis/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/__pycache__/__init__.cpython-310.pyc and b/trellis/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/models/__init__.py
CHANGED
|
@@ -9,6 +9,7 @@ __attributes = {
|
|
| 9 |
'SLatMeshDecoder': 'structured_latent_vae',
|
| 10 |
'SLatFlowModel': 'structured_latent_flow',
|
| 11 |
'ModulatedMultiViewCond': 'sparse_structure_flow',
|
|
|
|
| 12 |
}
|
| 13 |
|
| 14 |
__submodules = []
|
|
@@ -85,4 +86,4 @@ if __name__ == '__main__':
|
|
| 85 |
from .sparse_structure_vae import SparseStructureEncoder, SparseStructureDecoder
|
| 86 |
from .sparse_structure_flow import SparseStructureFlowModel, ModulatedMultiViewCond
|
| 87 |
from .structured_latent_vae import SLatEncoder, SLatGaussianDecoder, SLatMeshDecoder
|
| 88 |
-
from .structured_latent_flow import SLatFlowModel
|
|
|
|
| 9 |
'SLatMeshDecoder': 'structured_latent_vae',
|
| 10 |
'SLatFlowModel': 'structured_latent_flow',
|
| 11 |
'ModulatedMultiViewCond': 'sparse_structure_flow',
|
| 12 |
+
'ModulatedSLATMultiViewCond': 'structured_latent_flow',
|
| 13 |
}
|
| 14 |
|
| 15 |
__submodules = []
|
|
|
|
| 86 |
from .sparse_structure_vae import SparseStructureEncoder, SparseStructureDecoder
|
| 87 |
from .sparse_structure_flow import SparseStructureFlowModel, ModulatedMultiViewCond
|
| 88 |
from .structured_latent_vae import SLatEncoder, SLatGaussianDecoder, SLatMeshDecoder
|
| 89 |
+
from .structured_latent_flow import SLatFlowModel, ModulatedSLATMultiViewCond
|
trellis/models/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/__pycache__/__init__.cpython-310.pyc and b/trellis/models/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/models/__pycache__/sparse_structure_flow.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/__pycache__/sparse_structure_flow.cpython-310.pyc and b/trellis/models/__pycache__/sparse_structure_flow.cpython-310.pyc differ
|
|
|
trellis/models/__pycache__/sparse_structure_vae.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/__pycache__/sparse_structure_vae.cpython-310.pyc and b/trellis/models/__pycache__/sparse_structure_vae.cpython-310.pyc differ
|
|
|
trellis/models/__pycache__/structured_latent_flow.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/__pycache__/structured_latent_flow.cpython-310.pyc and b/trellis/models/__pycache__/structured_latent_flow.cpython-310.pyc differ
|
|
|
trellis/models/structured_latent_flow.py
CHANGED
|
@@ -311,6 +311,11 @@ class SLatFlowModel(nn.Module):
|
|
| 311 |
t_emb = self.adaLN_modulation(t_emb)
|
| 312 |
t_emb = t_emb.type(self.dtype)
|
| 313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
skips = []
|
| 315 |
# pack with input blocks
|
| 316 |
for block in self.input_blocks:
|
|
@@ -320,15 +325,8 @@ class SLatFlowModel(nn.Module):
|
|
| 320 |
if self.pe_mode == "ape":
|
| 321 |
h = h + self.pos_embedder(h.coords[:, 1:]).type(self.dtype)
|
| 322 |
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
cond_tmp = cond[i].type(self.dtype)
|
| 326 |
-
for block in self.blocks:
|
| 327 |
-
h = block(h, t_emb, cond_tmp)
|
| 328 |
-
else:
|
| 329 |
-
cond = cond.type(self.dtype)
|
| 330 |
-
for block in self.blocks:
|
| 331 |
-
h = block(h, t_emb, cond)
|
| 332 |
|
| 333 |
# unpack with output blocks
|
| 334 |
for block, skip in zip(self.out_blocks, reversed(skips)):
|
|
@@ -340,3 +338,61 @@ class SLatFlowModel(nn.Module):
|
|
| 340 |
h = h.replace(F.layer_norm(h.feats, h.feats.shape[-1:]))
|
| 341 |
h = self.out_layer(h.type(x.dtype))
|
| 342 |
return h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
t_emb = self.adaLN_modulation(t_emb)
|
| 312 |
t_emb = t_emb.type(self.dtype)
|
| 313 |
|
| 314 |
+
if isinstance(cond, list):
|
| 315 |
+
cond = [c.type(self.dtype) for c in cond]
|
| 316 |
+
else:
|
| 317 |
+
cond = cond.type(self.dtype)
|
| 318 |
+
|
| 319 |
skips = []
|
| 320 |
# pack with input blocks
|
| 321 |
for block in self.input_blocks:
|
|
|
|
| 325 |
if self.pe_mode == "ape":
|
| 326 |
h = h + self.pos_embedder(h.coords[:, 1:]).type(self.dtype)
|
| 327 |
|
| 328 |
+
for block in self.blocks:
|
| 329 |
+
h = block(h, t_emb, cond)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 330 |
|
| 331 |
# unpack with output blocks
|
| 332 |
for block, skip in zip(self.out_blocks, reversed(skips)):
|
|
|
|
| 338 |
h = h.replace(F.layer_norm(h.feats, h.feats.shape[-1:]))
|
| 339 |
h = self.out_layer(h.type(x.dtype))
|
| 340 |
return h
|
| 341 |
+
|
| 342 |
+
class ModulatedSLATMultiViewCond(nn.Module):
|
| 343 |
+
"""
|
| 344 |
+
Transformer cross-attention block (MSA + MCA + FFN) with adaptive layer norm conditioning.
|
| 345 |
+
"""
|
| 346 |
+
def __init__(
|
| 347 |
+
self,
|
| 348 |
+
channels: int,
|
| 349 |
+
ctx_channels: int,
|
| 350 |
+
dtype: Optional[torch.dtype] = torch.float32,
|
| 351 |
+
use_fp16: bool = True,
|
| 352 |
+
):
|
| 353 |
+
super().__init__()
|
| 354 |
+
self.linear_blocks = nn.ModuleList([
|
| 355 |
+
nn.Sequential(
|
| 356 |
+
nn.Linear(ctx_channels, channels, bias=True),
|
| 357 |
+
nn.ReLU(),
|
| 358 |
+
)
|
| 359 |
+
for _ in range(4)
|
| 360 |
+
])
|
| 361 |
+
self.fuse_blocks = nn.ModuleList([
|
| 362 |
+
nn.Sequential(
|
| 363 |
+
nn.Linear(ctx_channels, channels, bias=True),
|
| 364 |
+
nn.ReLU(),
|
| 365 |
+
)
|
| 366 |
+
for _ in range(4)
|
| 367 |
+
])
|
| 368 |
+
self.use_fp16 = use_fp16
|
| 369 |
+
if use_fp16:
|
| 370 |
+
self.dtype = torch.float16
|
| 371 |
+
else:
|
| 372 |
+
self.dtype = dtype
|
| 373 |
+
|
| 374 |
+
self.intermediate_layer_idx = [4, 11, 17, 23]
|
| 375 |
+
if use_fp16:
|
| 376 |
+
self.convert_to_fp16()
|
| 377 |
+
|
| 378 |
+
def convert_to_fp16(self) -> None:
|
| 379 |
+
"""
|
| 380 |
+
Convert the torso of the model to float16.
|
| 381 |
+
"""
|
| 382 |
+
self.use_fp16 = True
|
| 383 |
+
self.dtype = torch.float16
|
| 384 |
+
self.linear_blocks.apply(convert_module_to_f16)
|
| 385 |
+
|
| 386 |
+
def forward(self, aggregated_tokens_list: List, image_cond: torch.Tensor):
|
| 387 |
+
|
| 388 |
+
b, n, _, _ = aggregated_tokens_list[0].shape
|
| 389 |
+
idx = 0
|
| 390 |
+
cond = image_cond.reshape(b*n, -1, 1024).to(self.dtype)
|
| 391 |
+
for layer_idx in self.intermediate_layer_idx:
|
| 392 |
+
x = aggregated_tokens_list[layer_idx]
|
| 393 |
+
# x = x.reshape(b, -1, 2048) + torch.cat([image_cond.reshape(b, -1, 1024), image_cond.reshape(b, -1, 1024)],dim=-1)
|
| 394 |
+
x = torch.cat([x.reshape(b*n, -1, 2048), cond.reshape(b*n, -1, 1024)],dim=-1).to(self.dtype)
|
| 395 |
+
x = self.linear_blocks[idx](x)
|
| 396 |
+
cond = x + image_cond.reshape(b*n, -1, 1024).to(self.dtype)
|
| 397 |
+
idx = idx + 1
|
| 398 |
+
return cond
|
trellis/models/structured_latent_vae/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/structured_latent_vae/__pycache__/__init__.cpython-310.pyc and b/trellis/models/structured_latent_vae/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/models/structured_latent_vae/__pycache__/base.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/structured_latent_vae/__pycache__/base.cpython-310.pyc and b/trellis/models/structured_latent_vae/__pycache__/base.cpython-310.pyc differ
|
|
|
trellis/models/structured_latent_vae/__pycache__/decoder_gs.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/structured_latent_vae/__pycache__/decoder_gs.cpython-310.pyc and b/trellis/models/structured_latent_vae/__pycache__/decoder_gs.cpython-310.pyc differ
|
|
|
trellis/models/structured_latent_vae/__pycache__/decoder_mesh.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/structured_latent_vae/__pycache__/decoder_mesh.cpython-310.pyc and b/trellis/models/structured_latent_vae/__pycache__/decoder_mesh.cpython-310.pyc differ
|
|
|
trellis/models/structured_latent_vae/__pycache__/encoder.cpython-310.pyc
CHANGED
|
Binary files a/trellis/models/structured_latent_vae/__pycache__/encoder.cpython-310.pyc and b/trellis/models/structured_latent_vae/__pycache__/encoder.cpython-310.pyc differ
|
|
|
trellis/modules/__pycache__/norm.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/__pycache__/norm.cpython-310.pyc and b/trellis/modules/__pycache__/norm.cpython-310.pyc differ
|
|
|
trellis/modules/__pycache__/spatial.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/__pycache__/spatial.cpython-310.pyc and b/trellis/modules/__pycache__/spatial.cpython-310.pyc differ
|
|
|
trellis/modules/__pycache__/utils.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/__pycache__/utils.cpython-310.pyc and b/trellis/modules/__pycache__/utils.cpython-310.pyc differ
|
|
|
trellis/modules/attention/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/attention/__pycache__/__init__.cpython-310.pyc and b/trellis/modules/attention/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/modules/attention/__pycache__/full_attn.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/attention/__pycache__/full_attn.cpython-310.pyc and b/trellis/modules/attention/__pycache__/full_attn.cpython-310.pyc differ
|
|
|
trellis/modules/attention/__pycache__/modules.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/attention/__pycache__/modules.cpython-310.pyc and b/trellis/modules/attention/__pycache__/modules.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/__pycache__/__init__.cpython-310.pyc and b/trellis/modules/sparse/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/__pycache__/basic.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/__pycache__/basic.cpython-310.pyc and b/trellis/modules/sparse/__pycache__/basic.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/__pycache__/linear.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/__pycache__/linear.cpython-310.pyc and b/trellis/modules/sparse/__pycache__/linear.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/__pycache__/nonlinearity.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/__pycache__/nonlinearity.cpython-310.pyc and b/trellis/modules/sparse/__pycache__/nonlinearity.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/__pycache__/norm.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/__pycache__/norm.cpython-310.pyc and b/trellis/modules/sparse/__pycache__/norm.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/__pycache__/spatial.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/__pycache__/spatial.cpython-310.pyc and b/trellis/modules/sparse/__pycache__/spatial.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/attention/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/attention/__pycache__/__init__.cpython-310.pyc and b/trellis/modules/sparse/attention/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/attention/__pycache__/full_attn.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/attention/__pycache__/full_attn.cpython-310.pyc and b/trellis/modules/sparse/attention/__pycache__/full_attn.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/attention/__pycache__/modules.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/attention/__pycache__/modules.cpython-310.pyc and b/trellis/modules/sparse/attention/__pycache__/modules.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/attention/__pycache__/serialized_attn.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/attention/__pycache__/serialized_attn.cpython-310.pyc and b/trellis/modules/sparse/attention/__pycache__/serialized_attn.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/attention/__pycache__/windowed_attn.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/attention/__pycache__/windowed_attn.cpython-310.pyc and b/trellis/modules/sparse/attention/__pycache__/windowed_attn.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/conv/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/conv/__pycache__/__init__.cpython-310.pyc and b/trellis/modules/sparse/conv/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/conv/__pycache__/conv_spconv.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/conv/__pycache__/conv_spconv.cpython-310.pyc and b/trellis/modules/sparse/conv/__pycache__/conv_spconv.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/transformer/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/transformer/__pycache__/__init__.cpython-310.pyc and b/trellis/modules/sparse/transformer/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/transformer/__pycache__/blocks.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/transformer/__pycache__/blocks.cpython-310.pyc and b/trellis/modules/sparse/transformer/__pycache__/blocks.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/transformer/__pycache__/modulated.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/sparse/transformer/__pycache__/modulated.cpython-310.pyc and b/trellis/modules/sparse/transformer/__pycache__/modulated.cpython-310.pyc differ
|
|
|
trellis/modules/sparse/transformer/modulated.py
CHANGED
|
@@ -150,8 +150,14 @@ class ModulatedSparseTransformerCrossBlock(nn.Module):
|
|
| 150 |
h = h * gate_msa
|
| 151 |
x = x + h
|
| 152 |
h = x.replace(self.norm2(x.feats))
|
| 153 |
-
h = self.cross_attn(h, context)
|
| 154 |
-
x = x + h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
h = x.replace(self.norm3(x.feats))
|
| 156 |
h = h * (1 + scale_mlp) + shift_mlp
|
| 157 |
h = self.mlp(h)
|
|
|
|
| 150 |
h = h * gate_msa
|
| 151 |
x = x + h
|
| 152 |
h = x.replace(self.norm2(x.feats))
|
| 153 |
+
# h = self.cross_attn(h, context)
|
| 154 |
+
# x = x + h
|
| 155 |
+
if isinstance(context, list):
|
| 156 |
+
for ctx in context:
|
| 157 |
+
x = x + self.cross_attn(h, ctx) / len(context)
|
| 158 |
+
else:
|
| 159 |
+
h = self.cross_attn(h, context)
|
| 160 |
+
x = x + h
|
| 161 |
h = x.replace(self.norm3(x.feats))
|
| 162 |
h = h * (1 + scale_mlp) + shift_mlp
|
| 163 |
h = self.mlp(h)
|
trellis/modules/transformer/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/transformer/__pycache__/__init__.cpython-310.pyc and b/trellis/modules/transformer/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/modules/transformer/__pycache__/blocks.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/transformer/__pycache__/blocks.cpython-310.pyc and b/trellis/modules/transformer/__pycache__/blocks.cpython-310.pyc differ
|
|
|
trellis/modules/transformer/__pycache__/modulated.cpython-310.pyc
CHANGED
|
Binary files a/trellis/modules/transformer/__pycache__/modulated.cpython-310.pyc and b/trellis/modules/transformer/__pycache__/modulated.cpython-310.pyc differ
|
|
|
trellis/modules/transformer/modulated.py
CHANGED
|
@@ -138,13 +138,18 @@ class ModulatedTransformerCrossBlock(nn.Module):
|
|
| 138 |
shift_msa, scale_msa, gate_msa, shift_mlp, scale_mlp, gate_mlp = self.adaLN_modulation(mod).chunk(6, dim=1)
|
| 139 |
h = self.norm1(x)
|
| 140 |
h = h * (1 + scale_msa.unsqueeze(1)) + shift_msa.unsqueeze(1)
|
| 141 |
-
# h = torch.utils.checkpoint.checkpoint(self.self_attn, h)
|
| 142 |
h = self.self_attn(h)
|
| 143 |
h = h * gate_msa.unsqueeze(1)
|
| 144 |
x = x + h
|
| 145 |
h = self.norm2(x)
|
| 146 |
-
h = self.cross_attn(h, context)
|
| 147 |
-
x = x + h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
h = self.norm3(x)
|
| 149 |
h = h * (1 + scale_mlp.unsqueeze(1)) + shift_mlp.unsqueeze(1)
|
| 150 |
h = self.mlp(h)
|
|
|
|
| 138 |
shift_msa, scale_msa, gate_msa, shift_mlp, scale_mlp, gate_mlp = self.adaLN_modulation(mod).chunk(6, dim=1)
|
| 139 |
h = self.norm1(x)
|
| 140 |
h = h * (1 + scale_msa.unsqueeze(1)) + shift_msa.unsqueeze(1)
|
|
|
|
| 141 |
h = self.self_attn(h)
|
| 142 |
h = h * gate_msa.unsqueeze(1)
|
| 143 |
x = x + h
|
| 144 |
h = self.norm2(x)
|
| 145 |
+
# h = self.cross_attn(h, context)
|
| 146 |
+
# x = x + h
|
| 147 |
+
if isinstance(context, list):
|
| 148 |
+
for ctx in context:
|
| 149 |
+
x = x + self.cross_attn(h, ctx) / len(context)
|
| 150 |
+
else:
|
| 151 |
+
h = self.cross_attn(h, context)
|
| 152 |
+
x = x + h
|
| 153 |
h = self.norm3(x)
|
| 154 |
h = h * (1 + scale_mlp.unsqueeze(1)) + shift_mlp.unsqueeze(1)
|
| 155 |
h = self.mlp(h)
|
trellis/pipelines/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/__pycache__/__init__.cpython-310.pyc and b/trellis/pipelines/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/pipelines/__pycache__/base.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/__pycache__/base.cpython-310.pyc and b/trellis/pipelines/__pycache__/base.cpython-310.pyc differ
|
|
|
trellis/pipelines/__pycache__/trellis_image_to_3d.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/__pycache__/trellis_image_to_3d.cpython-310.pyc and b/trellis/pipelines/__pycache__/trellis_image_to_3d.cpython-310.pyc differ
|
|
|
trellis/pipelines/base.py
CHANGED
|
@@ -24,6 +24,9 @@ class Pipeline:
|
|
| 24 |
self.sparse_structure_flow_model = self.models['sparse_structure_flow_model']
|
| 25 |
if 'sparse_structure_vggt_cond' in self.models:
|
| 26 |
self.sparse_structure_vggt_cond = self.models['sparse_structure_vggt_cond']
|
|
|
|
|
|
|
|
|
|
| 27 |
@staticmethod
|
| 28 |
def from_pretrained(path: str) -> "Pipeline":
|
| 29 |
"""
|
|
|
|
| 24 |
self.sparse_structure_flow_model = self.models['sparse_structure_flow_model']
|
| 25 |
if 'sparse_structure_vggt_cond' in self.models:
|
| 26 |
self.sparse_structure_vggt_cond = self.models['sparse_structure_vggt_cond']
|
| 27 |
+
if 'slat_vggt_cond' in self.models:
|
| 28 |
+
self.slat_vggt_cond = self.models['slat_vggt_cond']
|
| 29 |
+
|
| 30 |
@staticmethod
|
| 31 |
def from_pretrained(path: str) -> "Pipeline":
|
| 32 |
"""
|
trellis/pipelines/samplers/__pycache__/__init__.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/samplers/__pycache__/__init__.cpython-310.pyc and b/trellis/pipelines/samplers/__pycache__/__init__.cpython-310.pyc differ
|
|
|
trellis/pipelines/samplers/__pycache__/base.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/samplers/__pycache__/base.cpython-310.pyc and b/trellis/pipelines/samplers/__pycache__/base.cpython-310.pyc differ
|
|
|
trellis/pipelines/samplers/__pycache__/classifier_free_guidance_mixin.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/samplers/__pycache__/classifier_free_guidance_mixin.cpython-310.pyc and b/trellis/pipelines/samplers/__pycache__/classifier_free_guidance_mixin.cpython-310.pyc differ
|
|
|
trellis/pipelines/samplers/__pycache__/flow_euler.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/samplers/__pycache__/flow_euler.cpython-310.pyc and b/trellis/pipelines/samplers/__pycache__/flow_euler.cpython-310.pyc differ
|
|
|
trellis/pipelines/samplers/__pycache__/flow_euler_old.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/samplers/__pycache__/flow_euler_old.cpython-310.pyc and b/trellis/pipelines/samplers/__pycache__/flow_euler_old.cpython-310.pyc differ
|
|
|
trellis/pipelines/samplers/__pycache__/guidance_interval_mixin.cpython-310.pyc
CHANGED
|
Binary files a/trellis/pipelines/samplers/__pycache__/guidance_interval_mixin.cpython-310.pyc and b/trellis/pipelines/samplers/__pycache__/guidance_interval_mixin.cpython-310.pyc differ
|
|
|