3 ms·
I would have expected an API like: let imageId = api.generateImage(prompt) let {url, isFinished} = api.imageInfo(id) But instead it's: let bytes
by hombre_fatal 2y ago
I would have expected an API like:
let imageId = api.generateImage(prompt)
let {url, isFinished} = api.imageInfo(id)
But instead it's:
let bytes = api.generateImage(prompt)
It's interesting to me how AI APIs let you hold such a persistent, active connection. I'm so used to anything that takes more than a second becoming an async background process where you notify the recipient when it's ready.
With Netflix, it makes sense that you can open a connection to some static content and receive gigabytes over it.
But streaming tokens from a GPU is a much more active process. Especially in this case where you're waiting tens of seconds for an image to generate.
- starik36 2y agoI can understand that for text answers, but what can you possibly do with streaming tokens for images?
- radicality 2y agoAFAIK, The newer models for image gen like this OpenAI one, don’t actually use the normal diffusion process (image generates all at once from blurry to finished), but use transformer architecture where the full final image is generated from top to bottom, as a stream of ‘tokens’. That’s why when you generate an image in chatgpt nowadays, it will start displaying in full resolution from the top pixel row and start loading towards the bottom.