replicate-python
replicate-python copied to clipboard
Improved controlnet input by keeping tempfile open during write/read
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