这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@zeke
Copy link
Contributor

@zeke zeke commented Nov 6, 2025

This PR adds support for Replicate text-to-image models that return a single URL string instead of an array of URLs.

This should fix replicate/huggingface-model-mappings#31, which is currently failing:

image

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

The ReplicateTextToImageTask now handles both string URLs and array
outputs from the Replicate API, consistent with other task implementations
like ReplicateImageToImageTask and ReplicateTextToVideoTask.
Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fix @zeke! If there are any issues with a model next time, feel free to set its status to staging and switch it back to live once it's fixed 🤗

@hanouticelina hanouticelina merged commit f1edf12 into huggingface:main Nov 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants