In this lecture, we're taking a look at image to image and image prompts.
These are tools inside of Leonardo, where you can use an existing image to influence the outputs that
you get from Leonardo.
It's a great way to work more visually and to not use text prompts as the dominant input for your work.
So image to image allows you to generate an image based on another image, whereas an image prompt essentially
takes more of the style from an image and uses it to influence the generations of images that you create.
So image to image is more about content and composition, whereas an image prompt is more to do with
stylistic interpretation.
Let's dive into Leonardo and take a look at how to use both of these image tools.
So we've come into the AI generation tool.
We're going to select a model to work with today.
I'm going to suggest that we work with Leonardo diffusion.
We've left all of the settings on their defaults, and if you scroll down on the left hand side, you'll
come to two options.
First, we have image to image, and after that we have image prompt.
First of all, we're going to work on image to image.
And what we're going to do is we're going to find an image that we want to use as inspiration.
One resource that I find very useful is Unsplash.com, which is a library of free to use images.
So you're allowed to use any of these images without concern for copyright infringement.
Every day new photographers upload beautiful images that you can use for free.
So have a look through here and I'm going to select one that I like.
Once you've found an image that you like, you can click on it right click and simply go to save image
as.
Now we'll come back into Leonardo and below our image to image selection.
We have the opportunity to either drag and drop an image or you can click on this box and locate it
inside of your computer.
Once you've found it, you can click on Enter.
Now, one thing to bear in mind is that Unsplash provides images often in.
A new image formats which are not accepted by Leonardo.
But if you download it, you will get the image in a JPEG which is accepted by Leonardo.
Leonardo also accepts PNGs, so make sure you've got either a PNG or a jpeg.
There will be a loading bar if you have a large image at the bottom and you'll need to wait for this
to complete before generating your image.
Underneath this we have a slider up here which says init strength.
This is a parameter that allows us to define how much of the initial image will be preserved.
So if we put the slider all the way to the top to 0.9, we're going to get a image that's very similar
to the one that we put in.
For example, I can pop in a prompt.
You can either put in something that enhances the content or completely changes it.
Here, I'm going to keep it similar to the option that we have.
And you can see with the 0.9 strength, it's pretty much outputted the exact same image with a slightly
different aspect ratio.
So let's completely change that.
But that all the way down to 0.04.
And you can see now it's completely gone in the other direction and presented us with something that
has a very little resemblance to the initial image.
So my suggestion is go for something in the middle.
I found around 0.6 to work best.
And you can see here we've got something that's resembling the initial image, but it's neither completely
something new or something that's far too similar.
I'm going to put the initial strength down a little bit here.
I've put it down to 0.44 and we're starting to get something a little bit more creative.
Now we can try the same tool, but with a completely different prompt.
Here is a prompt I've been working with that involves a skull and we're going to have a look at how
this affects the output.
So image prompts are a great quick way to get a certain style or a certain composition that we're looking
for.
And you can see here it's taken the colors and combined it with the original image prompt.
So I found that the image strength is too strong here, so I'm going to put it down.
And see if this gets closer to what I have in mind, which is actually having a skull rendered on the
screen.
And now we're starting to get the skull come out while keeping some of the elements from the original
image.
Here you can see we've probably gone a little bit too far towards the prompt.
And the real hack here is to fine tune your image and keep generating.
So this time I've upped my init strength to 0.3 and hopefully I will get a good balance between the
image and my prompt.
Well, that's pretty beautiful.
I'm loving this fourth option where we've got this.
Yeah.
This skull coming out of the page and the lines of the original abstract image coming together.
So the other option we have instead of imaged image is to use image prompt.
And once again you'll have the option to upload an image from your computer.
So let's go ahead and choose a different image.
This time I'll come back to Unsplash.
This time I'm going to use this attractive young female.
And I'm going to drag and drop it into the upload box.
And when using image prompts, you have two other options.
The first is image weight.
This is the slider below your upload box and it allows you to make the output look more like the reference
image.
Lower values adhere more to the text.
So if you put this all the way near the top to around six.
It's going to look more like the image.
The second one we have is creativity, scale, and this defines the amount of creativity we give to
the algorithm.
Essentially giving Leonardo the choice of what it wants to output.
So I'm going to leave this at about 0.3.
I'm going to leave the original.
Prompt that I used here, and I'm going to.
Go ahead.
And generate these images.
Bear in mind that the image prompt process has A2X token cost, so it costs two times as much to generate
an image.
So I will only generate two images this time.
And you can see that we've taken the image and combined it with a prompt to create this beautiful combination.
You can see it keeps some resemblance to her initial features and yet gives her an entirely new look.
And you can see here that Leonardo has gone off on its own jolly adventure and done pretty much what
it wants to do.
So essentially the creativity scale.
Defines how much input you have and how much input the algorithm has.
And if we go all the way to the other end of the creativity scale, we can see that it has taken a lot
more influence from the image and put less influence of its own stylistic intent into our work.
So let's go ahead and do another one together.
I invite you to pause the video here.
Find an image either from Unsplash or somewhere else and take it into Leonardo and use it as an image
prompt.
Now, let's take a look at what we came out with.
I took this image of a.
Asian city scene and uploaded it to Leonardo with the prompt urban night scene Graphic.
Moody.
Atmospheric.
Kyoto.
I used it as an image prompt, and I've got out these beautiful, scenic.
City scenes that I'm really happy with.
And so I've been able to quickly harness exactly what I wanted using an image prompt and a text prompt
together.
How did you get on?
Now, another cool trick is that you can actually use multiple images as prompts.
So if I were to take.
This dog download it.
Come back into Leonardo and drag it into the upload box.
I'm going to remove my Kyoto City scene and I'm actually going to upload an image of myself.
Feel free to put in whatever you like and have some fun combining images.
This is a great way to get interesting effects very quickly.
And you can put in whatever you like for the prompt.
I will enhance the combination of these two images.
And here you can see it's me crossed with a dog.
In this lecture, we took a look at image to image and image.
Prompt image to image looks at taking an image and transitioning it into another image.
Whereas image prompts, look at taking the stylistic integrity of an image and creating new images based
on that.
With image prompts, we can use multiple images together to create unique and interesting combinations.
Remember, you can find free images to use at unsplash.com and image prompts are a great way for moving
quickly towards a desired outcome.
So well done for taking this lecture.
See you in the next one.