Spaces:
Paused
Paused
Install Blender system-Python NumPy and check GLTF renderer before inference
Browse filesFiles changed (4)
1 unmodified line2341 unmodified linelibgl1libglib2.0-0git1 unmodified line23451 unmodified linelibgl1libglib2.0-0gitpython3-numpy
148 unmodified lines149150151152153154148 unmodified linesprepare_tools()print("fx and cleanup skills are ready.", flush=True)if not tools_only:prepare_models()(RUNTIME / "prepared.json").write_text(json.dumps(LOCK, indent=2))print("Pinned model assets and source adapters are ready.", flush=True)148 unmodified lines149150151152153154155156157148 unmodified linesprepare_tools()print("fx and cleanup skills are ready.", flush=True)if not tools_only:from studio.render import check_renderercheck_renderer()print("Blender GLTF imports are ready.", flush=True)prepare_models()(RUNTIME / "prepared.json").write_text(json.dumps(LOCK, indent=2))print("Pinned model assets and source adapters are ready.", flush=True)
21 unmodified lines222324252627282921 unmodified linesraise RuntimeError("Set the OPENROUTER_API_KEY Space secret before generating.")if not (RUNTIME / "bin/fx").is_file():raise RuntimeError("fx is not installed. Run uv run scripts/prepare_runtime.py.")from .render import blenderblender()def vision(prompt, images):21 unmodified lines222324252627282921 unmodified linesraise RuntimeError("Set the OPENROUTER_API_KEY Space secret before generating.")if not (RUNTIME / "bin/fx").is_file():raise RuntimeError("fx is not installed. Run uv run scripts/prepare_runtime.py.")from .render import check_renderercheck_renderer()def vision(prompt, images):
123414 unmodified lines192021222324import mathimport osfrom pathlib import Pathimport shutil14 unmodified linesreturn pathdef render(model, folder, components=False):folder.mkdir(parents=True, exist_ok=True)command = [blender(), "--background", "--factory-startup", "--python-exit-code", "1",1234514 unmodified lines20212223242526272829303132import mathfrom functools import lru_cacheimport osfrom pathlib import Pathimport shutil14 unmodified linesreturn path@lru_cache(maxsize=1)def check_renderer():subprocess.run([blender(), "--background", "--factory-startup", "--python-exit-code", "1","--python-expr", "import numpy; import io_scene_gltf2.blender.imp.mesh; print('GLTF renderer ready')"],check=True, timeout=60, capture_output=True, text=True)def render(model, folder, components=False):folder.mkdir(parents=True, exist_ok=True)command = [blender(), "--background", "--factory-startup", "--python-exit-code", "1",
packages.txt+1
scripts/prepare_runtime.py+3
studio/refine.py+2-2
studio/render.py+8