deepinfra / deepinfra-node

Official TypeScript wrapper for DeepInfra Inference API
https://deepinfra.com/
MIT License
8 stars 0 forks source link

Add data_url support in lib #13

Closed ichernev closed 5 months ago

ichernev commented 5 months ago

Currently the generic text-to-image (i.e sd2.1, dreamshaper) models return images in data_url format. Looking at this question, it looks like it's best if the library supports some data-url handling so the user can only focus on managing the bytes (instead of parsing the data-url as well).

I can work on that in the coming days, unless somebody does it faster :)

ichernev commented 5 months ago

Ah, we can just use const { data: image_data} = await axios.get(data_url_or_url), it works for both urls and data urls... it shouldn't be any slower for data urls anyway.