1
00:00:03,930 --> 00:00:08,790
In this lecture, we're taking a look at image to image and image prompts.

2
00:00:09,150 --> 00:00:17,160
These are tools inside of Leonardo, where you can use an existing image to influence the outputs that

3
00:00:17,160 --> 00:00:18,720
you get from Leonardo.

4
00:00:18,810 --> 00:00:26,190
It's a great way to work more visually and to not use text prompts as the dominant input for your work.

5
00:00:26,220 --> 00:00:34,800
So image to image allows you to generate an image based on another image, whereas an image prompt essentially

6
00:00:34,800 --> 00:00:41,490
takes more of the style from an image and uses it to influence the generations of images that you create.

7
00:00:41,520 --> 00:00:49,200
So image to image is more about content and composition, whereas an image prompt is more to do with

8
00:00:49,200 --> 00:00:50,940
stylistic interpretation.

9
00:00:50,970 --> 00:00:56,670
Let's dive into Leonardo and take a look at how to use both of these image tools.

10
00:00:56,940 --> 00:00:58,860
So we've come into the AI generation tool.

11
00:00:58,860 --> 00:01:01,000
We're going to select a model to work with today.

12
00:01:01,120 --> 00:01:04,660
I'm going to suggest that we work with Leonardo diffusion.

13
00:01:04,930 --> 00:01:11,050
We've left all of the settings on their defaults, and if you scroll down on the left hand side, you'll

14
00:01:11,050 --> 00:01:12,970
come to two options.

15
00:01:12,970 --> 00:01:16,570
First, we have image to image, and after that we have image prompt.

16
00:01:16,960 --> 00:01:19,450
First of all, we're going to work on image to image.

17
00:01:20,140 --> 00:01:24,790
And what we're going to do is we're going to find an image that we want to use as inspiration.

18
00:01:24,910 --> 00:01:32,950
One resource that I find very useful is Unsplash.com, which is a library of free to use images.

19
00:01:33,280 --> 00:01:39,610
So you're allowed to use any of these images without concern for copyright infringement.

20
00:01:40,000 --> 00:01:44,830
Every day new photographers upload beautiful images that you can use for free.

21
00:01:45,850 --> 00:01:50,310
So have a look through here and I'm going to select one that I like.

22
00:01:50,320 --> 00:01:55,030
Once you've found an image that you like, you can click on it right click and simply go to save image

23
00:01:55,030 --> 00:01:55,750
as.

24
00:01:56,350 --> 00:02:03,100
Now we'll come back into Leonardo and below our image to image selection.

25
00:02:03,100 --> 00:02:09,010
We have the opportunity to either drag and drop an image or you can click on this box and locate it

26
00:02:09,010 --> 00:02:11,950
inside of your computer.

27
00:02:12,690 --> 00:02:15,360
Once you've found it, you can click on Enter.

28
00:02:15,810 --> 00:02:21,360
Now, one thing to bear in mind is that Unsplash provides images often in.

29
00:02:22,190 --> 00:02:26,330
A new image formats which are not accepted by Leonardo.

30
00:02:26,330 --> 00:02:33,380
But if you download it, you will get the image in a JPEG which is accepted by Leonardo.

31
00:02:33,800 --> 00:02:39,180
Leonardo also accepts PNGs, so make sure you've got either a PNG or a jpeg.

32
00:02:39,200 --> 00:02:43,220
There will be a loading bar if you have a large image at the bottom and you'll need to wait for this

33
00:02:43,220 --> 00:02:46,940
to complete before generating your image.

34
00:02:46,970 --> 00:02:53,380
Underneath this we have a slider up here which says init strength.

35
00:02:53,390 --> 00:03:02,360
This is a parameter that allows us to define how much of the initial image will be preserved.

36
00:03:03,290 --> 00:03:11,300
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

37
00:03:11,300 --> 00:03:12,660
to the one that we put in.

38
00:03:12,680 --> 00:03:14,690
For example, I can pop in a prompt.

39
00:03:14,840 --> 00:03:19,670
You can either put in something that enhances the content or completely changes it.

40
00:03:19,700 --> 00:03:23,150
Here, I'm going to keep it similar to the option that we have.

41
00:03:23,870 --> 00:03:29,450
And you can see with the 0.9 strength, it's pretty much outputted the exact same image with a slightly

42
00:03:29,450 --> 00:03:31,190
different aspect ratio.

43
00:03:31,520 --> 00:03:33,410
So let's completely change that.

44
00:03:33,410 --> 00:03:36,530
But that all the way down to 0.04.

45
00:03:37,390 --> 00:03:42,100
And you can see now it's completely gone in the other direction and presented us with something that

46
00:03:42,100 --> 00:03:44,890
has a very little resemblance to the initial image.

47
00:03:44,890 --> 00:03:48,250
So my suggestion is go for something in the middle.

48
00:03:48,370 --> 00:03:52,030
I found around 0.6 to work best.

49
00:03:54,580 --> 00:04:00,190
And you can see here we've got something that's resembling the initial image, but it's neither completely

50
00:04:00,190 --> 00:04:03,880
something new or something that's far too similar.

51
00:04:04,750 --> 00:04:08,350
I'm going to put the initial strength down a little bit here.

52
00:04:09,070 --> 00:04:13,570
I've put it down to 0.44 and we're starting to get something a little bit more creative.

53
00:04:13,810 --> 00:04:17,770
Now we can try the same tool, but with a completely different prompt.

54
00:04:18,520 --> 00:04:24,700
Here is a prompt I've been working with that involves a skull and we're going to have a look at how

55
00:04:24,700 --> 00:04:27,580
this affects the output.

56
00:04:28,390 --> 00:04:35,140
So image prompts are a great quick way to get a certain style or a certain composition that we're looking

57
00:04:35,140 --> 00:04:35,560
for.

58
00:04:35,560 --> 00:04:40,120
And you can see here it's taken the colors and combined it with the original image prompt.

59
00:04:40,660 --> 00:04:44,860
So I found that the image strength is too strong here, so I'm going to put it down.

60
00:04:46,720 --> 00:04:52,480
And see if this gets closer to what I have in mind, which is actually having a skull rendered on the

61
00:04:52,480 --> 00:04:53,200
screen.

62
00:04:54,220 --> 00:04:58,480
And now we're starting to get the skull come out while keeping some of the elements from the original

63
00:04:58,480 --> 00:04:59,090
image.

64
00:04:59,110 --> 00:05:03,100
Here you can see we've probably gone a little bit too far towards the prompt.

65
00:05:03,860 --> 00:05:09,150
And the real hack here is to fine tune your image and keep generating.

66
00:05:09,170 --> 00:05:15,290
So this time I've upped my init strength to 0.3 and hopefully I will get a good balance between the

67
00:05:15,290 --> 00:05:16,640
image and my prompt.

68
00:05:16,670 --> 00:05:18,270
Well, that's pretty beautiful.

69
00:05:18,290 --> 00:05:21,610
I'm loving this fourth option where we've got this.

70
00:05:21,620 --> 00:05:22,010
Yeah.

71
00:05:22,010 --> 00:05:27,830
This skull coming out of the page and the lines of the original abstract image coming together.

72
00:05:28,400 --> 00:05:32,690
So the other option we have instead of imaged image is to use image prompt.

73
00:05:32,690 --> 00:05:37,280
And once again you'll have the option to upload an image from your computer.

74
00:05:38,670 --> 00:05:40,950
So let's go ahead and choose a different image.

75
00:05:40,950 --> 00:05:42,840
This time I'll come back to Unsplash.

76
00:05:46,820 --> 00:05:50,210
This time I'm going to use this attractive young female.

77
00:05:51,050 --> 00:05:55,250
And I'm going to drag and drop it into the upload box.

78
00:05:56,650 --> 00:06:00,180
And when using image prompts, you have two other options.

79
00:06:00,190 --> 00:06:02,320
The first is image weight.

80
00:06:03,520 --> 00:06:11,080
This is the slider below your upload box and it allows you to make the output look more like the reference

81
00:06:11,080 --> 00:06:11,800
image.

82
00:06:11,920 --> 00:06:14,890
Lower values adhere more to the text.

83
00:06:14,890 --> 00:06:19,150
So if you put this all the way near the top to around six.

84
00:06:20,810 --> 00:06:22,870
It's going to look more like the image.

85
00:06:22,880 --> 00:06:29,480
The second one we have is creativity, scale, and this defines the amount of creativity we give to

86
00:06:29,480 --> 00:06:30,560
the algorithm.

87
00:06:31,390 --> 00:06:36,880
Essentially giving Leonardo the choice of what it wants to output.

88
00:06:39,720 --> 00:06:43,080
So I'm going to leave this at about 0.3.

89
00:06:43,680 --> 00:06:45,450
I'm going to leave the original.

90
00:06:46,260 --> 00:06:48,540
Prompt that I used here, and I'm going to.

91
00:06:48,540 --> 00:06:49,470
Go ahead.

92
00:06:50,380 --> 00:06:52,400
And generate these images.

93
00:06:52,420 --> 00:07:01,480
Bear in mind that the image prompt process has A2X token cost, so it costs two times as much to generate

94
00:07:01,480 --> 00:07:02,350
an image.

95
00:07:04,890 --> 00:07:08,310
So I will only generate two images this time.

96
00:07:08,400 --> 00:07:14,370
And you can see that we've taken the image and combined it with a prompt to create this beautiful combination.

97
00:07:14,940 --> 00:07:21,300
You can see it keeps some resemblance to her initial features and yet gives her an entirely new look.

98
00:07:22,480 --> 00:07:28,120
And you can see here that Leonardo has gone off on its own jolly adventure and done pretty much what

99
00:07:28,120 --> 00:07:29,290
it wants to do.

100
00:07:29,970 --> 00:07:32,010
So essentially the creativity scale.

101
00:07:33,120 --> 00:07:37,320
Defines how much input you have and how much input the algorithm has.

102
00:07:38,200 --> 00:07:44,590
And if we go all the way to the other end of the creativity scale, we can see that it has taken a lot

103
00:07:44,590 --> 00:07:52,420
more influence from the image and put less influence of its own stylistic intent into our work.

104
00:07:53,190 --> 00:07:55,920
So let's go ahead and do another one together.

105
00:07:56,040 --> 00:07:58,150
I invite you to pause the video here.

106
00:07:58,170 --> 00:08:06,510
Find an image either from Unsplash or somewhere else and take it into Leonardo and use it as an image

107
00:08:06,510 --> 00:08:07,320
prompt.

108
00:08:13,410 --> 00:08:15,930
Now, let's take a look at what we came out with.

109
00:08:17,650 --> 00:08:19,960
I took this image of a.

110
00:08:20,960 --> 00:08:27,920
Asian city scene and uploaded it to Leonardo with the prompt urban night scene Graphic.

111
00:08:27,920 --> 00:08:28,250
Moody.

112
00:08:28,250 --> 00:08:29,180
Atmospheric.

113
00:08:29,830 --> 00:08:30,430
Kyoto.

114
00:08:31,090 --> 00:08:35,980
I used it as an image prompt, and I've got out these beautiful, scenic.

115
00:08:37,330 --> 00:08:39,940
City scenes that I'm really happy with.

116
00:08:41,000 --> 00:08:46,340
And so I've been able to quickly harness exactly what I wanted using an image prompt and a text prompt

117
00:08:46,340 --> 00:08:47,030
together.

118
00:08:48,900 --> 00:08:49,830
How did you get on?

119
00:08:50,160 --> 00:08:54,750
Now, another cool trick is that you can actually use multiple images as prompts.

120
00:08:55,020 --> 00:08:56,910
So if I were to take.

121
00:08:59,440 --> 00:09:01,750
This dog download it.

122
00:09:06,060 --> 00:09:11,160
Come back into Leonardo and drag it into the upload box.

123
00:09:11,670 --> 00:09:18,180
I'm going to remove my Kyoto City scene and I'm actually going to upload an image of myself.

124
00:09:18,210 --> 00:09:22,680
Feel free to put in whatever you like and have some fun combining images.

125
00:09:22,950 --> 00:09:27,420
This is a great way to get interesting effects very quickly.

126
00:09:29,340 --> 00:09:32,580
And you can put in whatever you like for the prompt.

127
00:09:33,210 --> 00:09:35,640
I will enhance the combination of these two images.

128
00:09:39,190 --> 00:09:42,070
And here you can see it's me crossed with a dog.

129
00:09:42,550 --> 00:09:46,480
In this lecture, we took a look at image to image and image.

130
00:09:46,480 --> 00:09:53,400
Prompt image to image looks at taking an image and transitioning it into another image.

131
00:09:53,410 --> 00:10:00,940
Whereas image prompts, look at taking the stylistic integrity of an image and creating new images based

132
00:10:00,940 --> 00:10:01,780
on that.

133
00:10:02,020 --> 00:10:09,070
With image prompts, we can use multiple images together to create unique and interesting combinations.

134
00:10:09,880 --> 00:10:18,460
Remember, you can find free images to use at unsplash.com and image prompts are a great way for moving

135
00:10:18,460 --> 00:10:21,090
quickly towards a desired outcome.

136
00:10:21,100 --> 00:10:23,020
So well done for taking this lecture.

137
00:10:23,050 --> 00:10:24,400
See you in the next one.

