Instructions to use pci-lab/worldflow3d with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use pci-lab/worldflow3d with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("pci-lab/worldflow3d", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Upload WorldFlow3D model (converted + remote code)
Browse filesFiles changed (7)
- front3d-color/model_index.jsonAdded+19
- front3d-color/scheduler/scheduler_config.jsonAdded+7
- front3d-color/scheduler/worldflow3d_scheduler.pyAdded+27
- front3d-color/unet/config.jsonAdded+98
- front3d-color/unet/diffusion_pytorch_model.safetensorsAdded+3
- front3d-color/unet/worldflow3d_unet.pyAdded+39
- front3d-color/worldflow3d_pipeline.pyAdded+35
12345678910111213141516171819{ "_class_name": [ "worldflow3d_pipeline", "WorldFlow3DPipeline" ], "_diffusers_version": "0.29.2", "unet": [ "worldflow3d_unet", "WorldFlow3DUNet" ], "scheduler": [ "worldflow3d_scheduler", "WorldFlow3DFlowScheduler" ], "vae": [ null, null ]}1234567{ "_class_name": "WorldFlow3DFlowScheduler", "_diffusers_version": "0.29.2", "num_train_timesteps": 1000, "prediction_type": "flow_velocity", "sigma_min": 0.0001}123456789101112131415161718192021222324252627"""Remote-code mirror for ``WorldFlow3DFlowScheduler`` (diffusers ``trust_remote_code``).
Referenced from ``model_index.json`` as the ``scheduler`` component::
"scheduler": ["worldflow3d_scheduler", "WorldFlow3DFlowScheduler"]
and placed inside the component subfolder ``<repo>/scheduler/worldflow3d_scheduler.py``(see ``worldflow3d_unet.py`` for the resolution rule diffusers 0.29.2 uses).
The scheduler is pure-python (numpy + torch, no custom kernels) so it *could* bemade fully self-contained here. We keep it a thin re-export of the installed``worldflow3d`` class for a single source of truth: that guarantees the Hub loadpath and the local ``from_converted`` path use byte-identical step math. If youever need a zero-dependency remote scheduler, inline the body of``worldflow3d.pipeline.scheduler`` here — it has no project-internal imports."""try: from worldflow3d.pipeline.scheduler import WorldFlow3DFlowSchedulerexcept ImportError as exc: # pragma: no cover - actionable message at load time raise ImportError( "Loading a WorldFlow3D model via trust_remote_code requires the " "'worldflow3d' package to be installed. Install it first, e.g.\n" " pip install --index-url https://test.pypi.org/simple/ worldflow3d # private dry-run\n" " pip install worldflow3d # public" ) from exc
__all__ = ["WorldFlow3DFlowScheduler"]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798{ "_class_name": "WorldFlow3DUNet", "_diffusers_version": "0.29.2", "attention_resolutions": [ 16, 8, 4 ], "channel_mult": [ 1, 2, 4, 8 ], "dropout": 0.0, "geometry_channels": 0, "in_channels": 4, "inpainting_channels": 0, "level_meta": { "H_channels": 4, "L_channels": 0, "channels": { "geometry": 0, "in": 4, "inpainting": 0, "map": 0, "micro": 0, "out": 4, "outpainting": 0, "tag": 0 }, "dataset_type": "front3d", "direct_diffusion": true, "factor": 2, "generator_type": "UNet3D", "has_layout": false, "has_tags": false, "initial_distribution": "tudf_0p044_latent", "is_coarsest": false, "layout_config": null, "layout_types": null, "level_name": "tudf_0p044_color", "output_chunk_size": [ 96, 96, 96 ], "source_noise_std": 0.25, "tag_types": null, "truncation": 0.1, "use_color": true, "use_separate_color_head": true, "voxel_size": 0.022 }, "level_spec": { "H_channels": 4, "L_channels": 0, "custom_output_chunk_size": [ 96, 96, 96 ], "feature_channels": 0, "input_voxel_size": 0.044, "internal_feature_channels": null, "is_coarsest": false, "is_finest": true, "is_pure_latent": false, "level_index": 1, "mode": "tudf", "name": "tudf_0p044_color", "normalize_latent": false, "normalize_points": true, "output_type": "voxel", "output_voxel_size": 0.022, "pretrained_TRELLIS": false, "reduce_spatial_extent": false, "representation": "dense", "sparse_latent": false, "truncation": 0.1, "use_color": true, "use_feature_supervision": false, "use_features": false, "with_occupancy": true }, "map_channels": 0, "micro_channels": 0, "model_channels": 128, "num_head_channels": -1, "num_heads": 8, "num_res_blocks": 2, "out_channels": 4, "outpainting_channels": 0, "tag_channels": 0, "use_fp16": false, "use_scale_shift_norm": true, "use_separate_color_head": true}123version https://git-lfs.github.com/spec/v1oid sha256:5657bf5363c00ad229093254fb6259d19bbf71ad7ddc2a39595c2e631fdb6220size 2688898936123456789101112131415161718192021222324252627282930313233343536373839"""Remote-code mirror for ``WorldFlow3DUNet`` (diffusers ``trust_remote_code``).
This single file is what diffusers downloads + executes when loading a publishedWorldFlow3D repo from the Hub. It is referenced from ``model_index.json`` as the``unet`` component::
"unet": ["worldflow3d_unet", "WorldFlow3DUNet"]
and must be placed **inside the component subfolder** of the repo, i.e.``<repo>/unet/worldflow3d_unet.py``. diffusers 0.29.2 resolves a component``[library_name, class_name]`` by first checking``os.path.isfile(<component_folder>/<library_name>.py)`` — if present it loads theclass via ``get_class_from_dynamic_module`` (the trust-remote-code path); otherwiseit falls back to ``importlib.import_module(library_name)`` (which fails for acustom top-level module name like ``worldflow3d_unet``). Hence the file lives nextto ``unet/config.json``.
Contract: this is a *thin re-export* of the real class from the installed``worldflow3d`` package. The full UNet torso lives in ``worldflow3d.models`` (amulti-file subpackage with sparse-conv / attention kernels) which is impractical tomirror as a single remote file, so the published-Hub flow REQUIRES the``worldflow3d`` package to be pip-installed (TestPyPI for the private dry-run, thenPyPI). The re-exported class is a genuine ``ModelMixin``/``ConfigMixin`` subclass,so ``WorldFlow3DUNet.from_pretrained(<repo>/unet)`` round-trips identically whetherdiffusers resolves the class from here or from the installed package."""try: from worldflow3d.pipeline.unet import WorldFlow3DUNet, WorldFlow3DUNetOutputexcept ImportError as exc: # pragma: no cover - actionable message at load time raise ImportError( "Loading a WorldFlow3D model via trust_remote_code requires the " "'worldflow3d' package to be installed (the remote files re-export the " "real classes from it; the UNet torso cannot be a single remote file). " "Install it first, e.g.\n" " pip install --index-url https://test.pypi.org/simple/ worldflow3d # private dry-run\n" " pip install worldflow3d # public" ) from exc
__all__ = ["WorldFlow3DUNet", "WorldFlow3DUNetOutput"]1234567891011121314151617181920212223242526272829303132333435"""Remote-code mirror for ``WorldFlow3DPipeline`` (diffusers ``trust_remote_code``).
This is the top-level custom-pipeline file diffusers downloads + executes when therepo's ``model_index.json`` declares a *list* ``_class_name``::
"_class_name": ["worldflow3d_pipeline", "WorldFlow3DPipeline"]
In diffusers 0.29.2 (``pipeline_utils.py:744-751``) a list ``_class_name`` makes theloader look for ``<repo>/worldflow3d_pipeline.py`` at the **repo root** (not inside asubfolder), import it via ``get_class_from_dynamic_module``, and use``_class_name[1]`` as the class. ``trust_remote_code=True`` must be passed.
NOTE: when ``_class_name`` is a plain string (``"WorldFlow3DPipeline"``) the loaderinstead requires the class to be importable from the installed ``diffusers`` or theclass you call ``from_pretrained`` on — which is why we publish with the *list* formso a bare ``DiffusionPipeline.from_pretrained(repo, trust_remote_code=True)`` workswithout the caller importing ``worldflow3d`` first.
Like the component mirrors, this re-exports the real class. The pipeline body pullsin the vendored ``conditioning``/``recon`` subpackages, so the installed``worldflow3d`` package is required (TestPyPI private dry-run, then PyPI)."""try: from worldflow3d.pipeline.pipeline import WorldFlow3DPipelineexcept ImportError as exc: # pragma: no cover - actionable message at load time raise ImportError( "Loading a WorldFlow3D pipeline via trust_remote_code requires the " "'worldflow3d' package to be installed (the remote pipeline file re-exports " "the real class, which depends on the vendored conditioning/recon " "subpackages). Install it first, e.g.\n" " pip install --index-url https://test.pypi.org/simple/ worldflow3d # private dry-run\n" " pip install worldflow3d # public" ) from exc
__all__ = ["WorldFlow3DPipeline"]front3d-color/model_index.jsonAdded+19
front3d-color/scheduler/scheduler_config.jsonAdded+7
front3d-color/scheduler/worldflow3d_scheduler.pyAdded+27
front3d-color/unet/config.jsonAdded+98
front3d-color/unet/diffusion_pytorch_model.safetensorsAdded+3
front3d-color/unet/worldflow3d_unet.pyAdded+39
front3d-color/worldflow3d_pipeline.pyAdded+35