huggingface.js icon indicating copy to clipboard operation
huggingface.js copied to clipboard

add support for image-to-image models on Replicate

Open zeke opened this issue 8 months ago • 2 comments

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

Example:

  • https://huggingface.co/stepfun-ai/Step1X-Edit
  • https://replicate.com/zsxkib/step1x-edit

cc @hanouticelina

zeke avatar May 05 '25 22:05 zeke

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

https://github.com/huggingface/huggingface.js/blob/b57822799149fb9e0c8a0b5ebf6b04ae1a417030/packages/inference/src/lib/getProviderHelper.ts#L134

Done! f449c0f6c9d1b02f2e354df295f15a43492e4b16

zeke avatar May 06 '25 19:05 zeke

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!

hanouticelina avatar May 14 '25 12:05 hanouticelina

Starting over here, since it seems a lot has changed: https://github.com/huggingface/huggingface.js/pull/1564

zeke avatar Jun 26 '25 21:06 zeke