This README describes the new capabilities added on top of the standard InfiniBench codebase:
- Cluster-Based Scene Optimization – furniture clusters (e.g., dining tables with chairs) can now be moved, rotated, and resampled as unified entities during the object-solving stage.
- Agentic Constraint Generation – an LLM-powered loop that turns a free-form scene description into procedural constraints and iteratively refines them using optimizer feedback.
- Camera Trajectory Optimization – a frontier-inspired algorithm that produces compact, collision-free camera paths covering every task-relevant object.
Each section below explains where the implementation lives and how to activate it.
Key files
infinigen/core/constraints/example_solver/clusters.pyinfinigen/core/constraints/example_solver/moves/cluster.pyinfinigen/core/constraints/example_solver/propose_clusters.pyinfinigen/core/constraints/example_solver/solve.py
What changed
- Clusters are dynamically identified from
StableAgainstrelations (e.g., chairs supported by the same table). - New move primitives (
cluster_translate,cluster_rotate,cluster_resample) keep all children rigidly coupled to their parent when exploring the search space. - Collision checks use a cluster-wide axis-aligned bounding box before accepting a move.
How to use
- The moves are active by default during
Solver.solve_objects. To restrict/weight them, edit your gin config:Solver.restrict_moves = ["addition", "cluster_translate", "cluster_rotate"] - All logging goes through the existing solver logger (
infinigen.core.constraints.example_solver.solve).
Key files
infinigen_examples/constraints/agentic_framework.pyinfinigen_examples/generate_indoors.py(new CLI flags)
What changed
AgenticConstraintGeneratorcomposes prompts using API docs + in-context examples (the default example ishome_furniture_constraints).AgenticSceneGeneratorruns an iterative loop: generate constraints → compile/validate → (optionally) feed optimizer feedback back to the LLM, enforcing chain-of-thought reasoning.compose_indoors()supports two new flags:scene_description: natural-language request (e.g., “a cluttered startup office”)use_agentic_constraints: toggle agentic mode on/offagentic_max_iterations: bound the CoT loop length
Example
python infinigen_examples/generate_indoors.py \
--scene_description "compact studio apartment with plants and wall art" \
--use_agentic_constraints True \
--agentic_max_iterations 3 \
-p solve_steps_large=400Under the hood, the agent compiles the generated code, injects it via constraint_builder = agentic_result.final_program.to_callable(...), and then the usual greedy + simulated annealing pipeline takes over.
Note: By default, the provided
DummyLLMsimply replays the reference example. PointAgenticConstraintGeneratorat a real LLM client to produce novel programs.
File: infinigen_examples/trajectory_optimizer.py
Concept
- Implements the four-step loop from the paper:
- Select the nearest unvisited target object.
- Sample viewpoint candidates (checking accessibility, field of view coverage, and occlusions).
- Plan a path via Dijkstra on a 2D navigation graph (camera height assumed constant).
- Move to the best-scoring viewpoint and mark the object as visited.
- The resulting trajectory is exported as a JSON list of
{position, rotation_euler}entries.
CLI usage
blender --background --python infinigen_examples/trajectory_optimizer.py -- \
--blend /path/to/scene.blend \
--output /tmp/trajectory.json \
--samples 1500 \
--grid 0.6The script opens the .blend file, identifies mesh targets (excluding lights, windows, etc.), builds the navigation graph, and writes the trajectory to --output.
- Performance: Cluster moves add more candidate proposals; reduce their weights via gin if your solve time increases too much.
- LLM Failures: If an LLM-generated constraint crashes compilation, the agent logs the exception and retries up to
agentic_max_iterations. - Trajectory Planning: For large scenes, increase
--gridto coarsen the navigation graph, or raise--samplesfor higher-quality viewpoints.
Feel free to adapt the registry/examples in agentic_framework.py to teach the LLM agent about other procedural APIs or constraint sets.