Skip to content

add support for image-to-image models on Replicate #1427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

zeke
Copy link
Contributor

@zeke zeke commented May 5, 2025

This PR adds support for the image-to-image task type for Replicate models.

Example:

cc @hanouticelina

@zeke zeke marked this pull request as ready for review May 5, 2025 22:27
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 PR @zeke, could you please update the task mapping as well?

@zeke
Copy link
Contributor Author

zeke commented May 6, 2025

thanks for the PR @zeke, could you please update the task mapping as well?

Done! f449c0f

hanouticelina added a commit that referenced this pull request May 14, 2025
…nference API (#1439)

This PR is a prerequisite for #1427. 

It refactors the payload construction for `hf-inference` by isolating it
into a separate async function. Note that adding a new async function to
build the payload is necessary because
`HFInferenceImageToImageTask.preparePayload` cannot be made async, yet
the payload construction requires asynchronous operations. A similar
pattern has already been implemented for
[automaticSpeechRecognition](https://github.com/huggingface/huggingface.js/blob/361a0fad4c68943592f0bcbe41592d785eedcb81/packages/inference/src/tasks/audio/automaticSpeechRecognition.ts#L36)
with fal.
@hanouticelina
Copy link
Contributor

Hi @zeke,
#1439 has been merged — could you implement a preparePayloadAsync function in ReplicateImageToImageTask?
You’ll need to make sure that the function returns the payload in the format expected by Replicate. You can take a look at the hf-inference implementation for reference. Let me know if you need any help!

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