This is a work in progress project it uses DALLE-2 to expand the image automatically with the auto generated prompt
The marked points in this example are the centers for each generation frame, which so far took the most amount of work to make
the points are generated based on the desired amount of context that DE2 will be given and the size of the final image.
it has a specific order that generates the sides before corners in order to give the AI more context when generating the corners, but also without overlapping too much in order to make the generation get too few new pixels
#Auto image expander
72 messages · Page 1 of 1 (latest)
Original image
Generation steps
It can expand an image in all directions and generates points accordingly depending on the desired final size for the image
for exmaple, an 1024x1024 to 1920x1080 with the image at the bottom center, it would generate like this
and any other crazy resolutions, for example.. 2000x2000 with the source image at the top left
// this script will probably not be shared
Nice! Well done.
Well done! how do you get a text description of an image?
What coding language did you use?
Typescript
but im having issues with the replicate lib, I might convert it to plain JS
Looks like it works just as fine with no prompt at all, which is good because that way, no extra API is needed
but it has to do smaller steps in order for the AI not have the opportunity to hallucinate random stuff
You can always just write the style in the prompt but not the subject. Since it may end up being out of frame later.
I've been doing no prompt for a while but half the time it seems to turn the image into an album cover or something else with text in it.
Yeah that’s what I’ve been doing but it hasn’t been great half the time
why?
do you have some images that where not great for you?
I could use them to test if it works for me
I get text in my images, like this.
but was the original cropped?
i mean, did it had those borders?
Starting with this. The above image wasn't even using the expansion yet, I just added padding.
oh
I know the problem, you expanded the image on all sides at the same time
with no prompt
that is too much "emptyness" for Dalle, it will hallucinate too much
With my expander it expands the left right top bottom, then does the corners. It keeps half of the original image for the first four expansions.
I feel like if I write the subject it don't do it, but I'll fix that later.
here is an example, the step was too high:
still coherent, but this weas never intended to be part of the image
it added a person
I see
looks nice
@sly beacon github link?
this is not a public project
I would be happy to give advice to anyone trying to make a similar one =P
just ask if needed
I need to make a similar project can you suggest some quality resources to do so. Thanks in advance😃
bessides the openAI API docs, you should check the documentation of watever image manipulation libs you are going to use
this code all boild sown to handling the generation frame
the most troublesome part was to make an algorithms that pass over all the parts of the image, while avoiding overlaps, but yet, overlapping where it matters in order to give the AI more context
this one is a good showcase of the order in which this algorythm chooses the places to generate
the process is basically:
1- take the original image and add a huge transparent margin to make it bigger than the desired resolution
2- generate the center points where the generation frame will be positioned
3- for each point of the generation frame, produce a standalone 1024x1024 piece, apply the OpenAI API image generation method, then, take the result from it and composite that result image back into the large transparent image
4 - crop the image to trhe desired size, and it is done
the msot important part of it all is the point generation, as it has some requirements, for example, avoid having the cente rpoint positioned in such a way that will cause pixels to be created in a area that would be outside of the final image (as it will be just wasteful)
in your project we will need to be connected with our openai account to use it ?
this is a private project, just a showcase, not a actual self promotion of a service
I might make something similar and open source in the future
but not yet
ok fine. 👍
What is the program?
so ur not releasing it ?
Thanks ♥️
@sly beacon Have an update about this?