Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use upscale feature? #14

Open
TexturedPolak opened this issue Jul 7, 2023 · 6 comments
Open

How to use upscale feature? #14

TexturedPolak opened this issue Jul 7, 2023 · 6 comments

Comments

@TexturedPolak
Copy link

Przechwycenie obrazu ekranu_2023-07-07_13-34-33

@FireHead90544
Copy link
Owner

Until yet, I haven't implemented the upscale feature. Will be doing so pretty soon.

@FireHead90544
Copy link
Owner

It is still yet to be implemented. I'll be doing it some time later, until then if anyone would like to implement it, here's the info you'd require.

Upscale

ENDPOINT: https://api.craiyon.com/upscale

Payload Format:

{"image_id": "date/imagepath.ext", "model": "none", "negative_prompt": "", "prompt": "", "token": "null", "version": "c4ue22fb7kb6wlac"}

Upscaled Image: "https://pics.craiyon.com/" + resp.json()["images"][0]

Keep it as a separate entity (function) inside the Craiyon class, so that we could upscale by invoking something like

generator = Craiyon()
image = generator.upscale("2023-08-21/de9e76d570eb496086afa71979a11706.webp") # <-- This would be a link

@TexturedPolak
Copy link
Author

Oh, thanks, maybe I'm do it :)

@TexturedPolak
Copy link
Author

But you can give me link to API reference (for api.craiyon.com?
That's helpfull know what is image_id etc.

@FireHead90544
Copy link
Owner

But you can give me link to API reference (for api.craiyon.com? That's helpfull know what is image_id etc.

There isn't any API reference provided by them. All you could find is by surfing the network usage of the website. The image_id is the path to the image resource on craiyon's cdn generated when a prompt is entered and image is generated.

Basically, the 9 images generated by craiyon.

generator = Craiyon()
result = generator.generate("cool apple")
image_ids = [i.replace("https://img.craiyon.com/") for i in result.images]

Here image_ids would be a list of image ifs that can be used as Upscale endpoint's payload.

@TexturedPolak
Copy link
Author

Ok, thanks :)

Repository owner deleted a comment from mahmoudfranc Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants