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
fix(inference): support string URL output in Replicate text-to-image (#1835)
This PR adds support for Replicate text-to-image models that return a
single URL string instead of an array of URLs.
This should fixreplicate/huggingface-model-mappings#31, which
is currently failing:
<img width="1048" height="432" alt="image"
src="https://github.com/user-attachments/assets/a9750364-7b8d-4f2f-96e9-4a1afb39af40"
/>
## Solution
The `ReplicateTextToImageTask.getResponse` method previously only
handled array outputs, causing errors for models that return a single
string URL. This change makes the text-to-image implementation
consistent with other tasks like `ReplicateImageToImageTask` and
`ReplicateTextToVideoTask`, which already support both formats.
## Prompts
> Does the replicate text-to-image implementation in this codebase
support models that return a URL as output? Or does it always expect an
array of image URLs?
> Let's update it to allow URL strings as a valid output response
> commit the changes to a branch, push it, and open a PR against the
upstream repo: huggingface/huggingface.js
---------
Co-authored-by: Celina Hanouti <hanouticelina@gmail.com>
0 commit comments