replicate-python icon indicating copy to clipboard operation
replicate-python copied to clipboard

Improved controlnet input by keeping tempfile open during write/read

Open mahdirahimi1999 opened this issue 9 months ago • 0 comments

Summary

This PR simplifies how we handle temporary files for the control image in the ControlNet pipeline. The tempfile is now used for both writing and reading without reopening it.

Changes

  • Combined write and read logic for tempfile
  • Used seek(0) to reset the file pointer

Benefits

  • Cleaner and more efficient code
  • Fewer file operations

mahdirahimi1999 avatar Apr 06 '25 11:04 mahdirahimi1999