dalle2-in-python icon indicating copy to clipboard operation
dalle2-in-python copied to clipboard

Add support to add image to favorites

Open charlesjlee opened this issue 3 years ago • 4 comments

The DALL·E UI allows you to mark an image as a "favorite", which just saves a reference to a collection. It would be nice to do this programatically.

charlesjlee avatar Jul 22 '22 01:07 charlesjlee

Like in #10 generation id needs to be cached

the endpoint is https://labs.openai.com/api/labs/collections/private/generations

import requests

auth_header = "Bearer sess-......"

payload = {"generation_ids": ["generation-ExyZNQNG5xzIkYqmPfOejUzP"]}

ret = requests.post(
    f"https://labs.openai.com/api/labs/collections/private/generations",
    headers={"Authorization": auth_header},
    json=payload,
)
print(ret.json())

generation_ids seems to be accepting a list of IDS, but i didn't test what happens if you actually put here multiple generations

kv-crosstech avatar Aug 11 '22 12:08 kv-crosstech

Off topic: I'm actually quite shocked, that no one has done what I just did. This library can be (and probably will be) very helpful for developers before OpenAI releases actual API with documentation.

kv-crosstech avatar Aug 11 '22 12:08 kv-crosstech

@ezzcodeezzlife do you need PR for any of these?

kv-crosstech avatar Aug 11 '22 13:08 kv-crosstech

@kv-crosstech if you want to add these features feel to do so 🔥 ill merge asap

ezzcodeezzlife avatar Aug 11 '22 13:08 ezzcodeezzlife