1

I am using the Stable Diffusion API for image generation, one of whose parameters is an image I will have to pass in as an URL string.

For example, if I want to use the image of a monkey, I can use

url: 'https://media.npr.org/assets/img/2017/09/12/macaca_nigra_self-portrait-3e0070aa19a7fe36e802253048411a38f14a79f8-s1100-c50.jpg'

However, I plan on using some images (PNG format) that I have stored in my local repository instead. Is there a quick possible way, or library (preferably in JavaScript) that allows me to dynamically generate an URL for the image? Thanks

1
  • What do you mean by "local repository"? Can you share the code you are currently using? Commented Aug 30, 2023 at 7:09

1 Answer 1

0

If uploading the images to the internet for the API to get access to them is not an option you can use data urls. Encode the file into a data url and use that in the request.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.