Replies: 1 comment
-
Can you link to a space with your full code? Make sure in your |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to build on Eliott Coyac's (image to text space) and Radamés Ajna's Observable. While I2T or T2I work just fine, when it comes to I2I I'm at a loss: Whatever I'm trying, I'm getting: "Error: hf.imageToImage is not a function".
Question: While the reference recommends
inputs: new Blob([readFileSync("image.png")])
using the fs.readFileSync module, I'm wondering if there's a way around that. Here's 3 different attempts that were, unfortunately, unsuccessful.Attempt 1: Fetching an image from a URL, converting it to a base64 string, and creating a Blob from this string.
Attempt 2: Fetching an image from a URL, converting it to a Uint8Array (Raw Data) and creating a Blob from this array.
Attempt 3 (absolute overkill due to fun & stubbornness): Fetching an image from a URL, converting it to both a Blob and a base64 string, processing the base64 string (and removing the b64-prefix to get it as close to the package on hf when using the widget on the model page) to recreate a Blob.
Beta Was this translation helpful? Give feedback.
All reactions