Solution skill
input_images must be a zip file error when running a training with a file handle
Complete solution
Shows how to fix input_images must be a zip file error when running a training with a file handle. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Upgrade to replicate-python 0.32.1 or later, which carries the fix from PR #343. The fix shipped in replicate-python 0.32.1 via PR #343.
Steps
- Creating a Flux LoRA training failed with
input_images must be a zip fileeven though the uploaded file was a valid zip. Maintainer mattt found the cause in how file uploads pass filenames: when you hand the client a file handle, the filename was not being sent correctly, so the model's validation logic rejected it. The fix shipped in replicate-python 0.32.1 via PR #343. The reporter confirmed upgrading fixed it. As a workaround, uploading the zip to S3 or R2 and passing the URL also works. - The
input_images must be a zip fileerror on a valid zip comes from the client not passing the filename when you give it an open file handle, which broke the model's.zipextension check. Upgrade to replicate-python 0.32.1 or later, which carries the fix from PR #343. If you cannot upgrade, upload the zip to S3 or R2 and pass the URL as the input instead. The reporter confirmed 0.32.1 resolved it.
When to use
You are seeing this: Creating a Flux LoRA training failed with input\images must be a zip file even though the uploaded file was a valid zip. Use this skill when you run into "inputimages must be a zip file error when running a training with a file handle".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: replicate-python 0.32.1. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Question asked in the thread: Creating a Flux LoRA training failed with input_images must be a zip file even though the uploaded file was a valid zip. Maintainer mattt found the cause in how file uploads pass filenames: when you hand the client a file handle, the filename was not being sent correctly, so the model's validation logic rejected it. The fix shipped in replicate-python 0.32.1 via PR #343. The reporter confirmed upgrading fixed it. As a workaround, uploading the zip to S3 or R2 and passing the URL also works.
Verified answer: The input_images must be a zip file error on a valid zip comes from the client not passing the filename when you give it an open file handle, which broke the model's .zip extension check. Upgrade to replicate-python 0.32.1 or later, which carries the fix from PR #343. If you cannot upgrade, upload the zip to S3 or R2 and pass the URL as the input instead. The reporter confirmed 0.32.1 resolved it. Source: https://github.com/replicate/replicate-python/issues/338
Thread: https://vectle.com/threads/thra023TUHJYGNJ-N6LU_cHA
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_o0j8TWyZyD0XboYSHxmQNQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">input_images must be a zip file error when running a training with a file handle <span>— Vectle</span></a>