You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
export_to_obj returns None, so the default temp output path is lost (unlike export_to_ply/export_to_gif/export_to_video) #15493
diffusers.utils.export_to_obj(mesh, output_obj_path=None) creates a temporary .obj file when no path is given, but never returns the path. The caller gets None and has no way to find the file it just wrote. Every other exporter in the same module (export_to_ply, export_to_gif, export_to_video) returns the path, and export_to_obj is otherwise a near copy of export_to_ply, so the missing return looks like an oversight. The function also has no docstring.
I would like to open a PR with the fix (a one-line return, a docstring, and a regression test). Could a maintainer acknowledge this first, per the "AI-assisted and agentic contributions" section of CONTRIBUTING.md? The fix was prepared with AI assistance (Claude Code) and reviewed by me.
src/diffusers/utils/export_utils.py, export_to_obj (around lines 104-121): output_obj_path is set to a NamedTemporaryFile(...).name when None (line 106), the file is written (line 120-121), and the function ends without return output_obj_path. Compare export_to_ply, which ends with return output_ply_path.
Proposed fix
Add return output_obj_path, a -> str annotation and a short docstring. Add a regression test in tests/others/test_utils.py using a stub mesh (default path and explicit path).
(src/diffusers/utils/testing_utils.py and tests/testing_utils.py carry private copies of the same helper with the same omission. They are test helpers rather than public API, so I would leave them alone unless you prefer otherwise.)
Activity