00:00:00
Hey everyone, Rodney here at Kleebz Tech, and
today I'm going to show you how to get accurate
00:00:03
text on t-shirts on people in your images, like
these. Now, this is not something that works
00:00:07
perfectly, but it does often do a pretty decent
job. It depends on the image that you're working
00:00:13
with, and I'm going to make things difficult on
myself by not using easy images to do this. So,
00:00:19
we're going to try to generate some stuff like
this. I do recommend watching my video I have
00:00:24
on text already that this is building
upon. This is a little more difficult
00:00:30
than that, which works very well.
This one's a challenge sometimes,
00:00:33
but I'm going to give you tips on how you
can try to get better results from it.
00:00:37
So, why don't we just start and get right
into it? There's no perfect way of doing this,
00:00:44
and it doesn't always work well with every image
generated. I'm going to show you the system of
00:00:50
how I do it. Hopefully, these come out well. I've
gotten some to come out well, and others can be
00:00:56
a challenge. The idea behind this is trying to
generate t-shirts with words on them, sayings,
00:01:02
or designs with words and getting accurate text.
This is purely about text, but it can also be used
00:01:09
for other stuff as well. One of the issues is,
a lot of times, if you try to get what you want,
00:01:15
it's not going to work. If you use in-painting, it
looks copied and pasted. There are other ways of
00:01:20
doing this sort of stuff. For example, in this one
I did in [__], which I can show at the end of this
00:01:26
video real quick how I did this. This is useful
for doing it that way if you have a specific
00:01:32
design you're trying to get on there. It doesn't
always work perfectly, but it is an option.
00:01:37
Let's say you want to generate one, and you want
to have the text and stuff like that to actually
00:01:43
work and spell the proper words. Well, that's
what I'm going to show you today. For this one,
00:01:48
let's go ahead and just start off
with one of these images, but first,
00:01:51
I'm going to set everything up. I'm using Fooocus;
you should be able to do this in pretty much any
00:01:55
of the UIs. There's a little bit different on how
they work. I do like the main engine for Fooocus,
00:02:01
and I personally think it's the best, even if
you just use it for in-painting. We're going to
00:02:06
check off the input image tab down at the bottom.
We're going to be mostly working in the in-paint,
00:02:10
out-paint, and the image prompt area down
here. I'm going to check off Advanced as well,
00:02:15
the advanced tab. We're going to check
off the developer debug mode, and in here,
00:02:19
we're going to go into the control tab.
We need mixing image prompt and in-paint;
00:02:23
we need to check that off. Then we're just going
to click on the in-paint tab and have that open.
00:02:27
A lot of times, if you were just to go ahead
and try to use the image prompts with the
00:02:32
text that I'm going to show, it's not going to
work properly; things won't line up. But I'll
00:02:37
show you how to get that to work. If you have
seen my other video on how to get good text,
00:02:41
this is basically the same idea with some
slight modifications. The basic concept is
00:02:46
still the same. If you haven't seen that,
I do suggest looking at that one. It works
00:02:52
well on flat surfaces for signs or anything
like that. The shirts are a little harder,
00:02:57
as I said. It doesn't always work for every shirt,
doesn't always work for every design. It takes a
00:03:01
little bit of practice, but once you get used to
it, you can get halfway decent results. They may
00:03:06
not always look perfect, though; I will warn
you of that. And if you see any flickering or
00:03:11
anything while I'm doing this, my video card,
I think, is about to die, so hopefully not.
00:03:17
I'd like to be able to continue recording
videos and not have to put that on pause.
00:03:20
So, let's start off with this image down here.
Yeah, we'll do this one. Drag it down, then in
00:03:30
the in-painting area, I'm going to select a larger
mask. If you're not familiar with in-painting,
00:03:36
I do suggest watching my in-painting tutorial.
Now, what we need to do at this point is we're
00:03:44
not going to generate anything. It doesn't really
matter; we can get rid of some of these things in
00:03:48
the prompt. You want to put your text in the
quotes. Now, we're going to be using something
00:03:53
different for this, but we are going to just
prepare the prompt at the moment. The in-paint
00:03:58
respective field, that's what we want to pay
attention to first right here. Now, if we go
00:04:02
all the way to one, when it goes to in-paint, it's
going to use the whole image. It won't upscale,
00:04:07
won't do anything, but what happens is, at that
point, we're going to be putting some text into
00:04:11
the image prompt, and when we do that, it's
going to have a hard time keeping that text
00:04:17
together because it's going to be so small at
that point. So, we need to have the image zoom in,
00:04:23
and the way to do that is to slide this
down. Normally, it's around six or so,
00:04:28
but we actually are going to slide this not all
the way down because then it doesn't take any of
00:04:32
the image around it into effect. And we want
that because it's useful for reference. So,
00:04:39
I'm going to bring this down a little bit,
probably to about 0.2. We'll give that a shot.
00:04:43
Now, the first time we generate, we're actually
not going to generate anything. I just need to
00:04:47
get some numbers, and if you've watched my other
video on text, you'll know why I'm doing this.
00:04:52
But at this point, once we go ahead and hit
the generate button, we're going to want the
00:04:57
command window open. Now, my system, when I
go to do this in upscale while I'm recording,
00:05:04
can have issues. So, I'm going to try to leave
this open to show you exactly what happens. So,
00:05:08
let's hit generate. Now I'll minimize my window
here and we'll see if it actually does this.
00:05:17
There's one number you want to pay attention to
here, that's the 425x425, that's the section of
00:05:22
the image that it's going to be working on.
Now, the other thing I do here as well is,
00:05:28
for reference, I'm going to take a screenshot
of this. That's just so I have a rough idea of
00:05:39
what it's working on. So, I'm going to save that.
Now that we have that, we can work on getting our
00:05:47
text. We don't need this to finish, but I'm
going to let this finish because I do want
00:05:51
to show something. One of the things to keep in
mind when doing this is, the shirt doesn't look
00:06:01
right. We're wanting to get more of a faded
look, a worn look. So, this doesn't always
00:06:08
work well when you try to do the in-painting on
the shirt. I'll show you how to get around that.
00:06:15
Now we want to get our text. I've already got one
prepared here, but I'm going to change the size
00:06:20
because I don't have the proper size because I
didn't know. So, we're going to put 425. I'm going
00:06:25
to resize this. The other thing that I do is I'll
bring in that image, and that's close enough for
00:06:35
what we're doing here. I've got my text where I
want it. You can use any tool; I do this in Adobe
00:06:41
Express just because I like the text effects.
Working with text in here works very well. The
00:06:49
other thing to keep in mind is when you're working
with the text, the font, it's usually best to have
00:06:54
a thicker, bolder font, and it won't always keep
the same font. We'll go with this one; we're going
00:07:01
to leave it there. And the background color,
I find you don't want to go with transparent;
00:07:07
that doesn't work well. I'm still trying to figure
out which colors work the best. I tend to go with
00:07:15
the same background color. Then we're going to
go ahead and download and save that image. We're
00:07:20
going to go to our image prompt tab, and then I'm
going to bring in that text that I just created.
00:07:26
I'm going to put this on CPDS. Pyrocanic can
work as well. Play around to determine the stop
00:07:33
value, which is when it stops influencing it.
You want that usually pretty high, otherwise,
00:07:38
the text can start to fall apart. But the higher
you go, it does impact the rest of the generation.
00:07:45
Now, the other thing is, if you want to do
anything else, like I'm going to drop this image
00:07:50
in here just as a reference. For the robot, there
we go. Now I have everything set. I have my prompt
00:07:59
set, I do have the text in the prompt and here, so
that helps influence each other. If you don't put
00:08:06
the text in the prompt, I find it doesn't work as
well. Now we're not going to touch this in-paint
00:08:11
respective field at this point because we've
already set this, and if we were to change that,
00:08:15
it can mess up the image prompt that we're
using. The other thing we need to do is the
00:08:22
main denoising strength. One of the reasons this
looks kind of fake is because it regenerates
00:08:29
that whole image right from scratch where
we've masked. So, if we go in and look here,
00:08:35
that gets completely regenerated. We want
to make the shirt look more like it's worn,
00:08:42
like the graphics are on the shirt and
to maintain some of those wrinkles and
00:08:49
things like that and contours that make it
look more believable. We're going to need
00:08:54
to lower this down. That way, it doesn't
completely destroy what's underneath it;
00:09:00
it still uses it. Now, a high number
means that it mostly starts from scratch.
00:09:05
If you bring it way down, it barely will change
anything at all. Actually, if you go down there,
00:09:12
it's not going to do anything. For the most part,
you're going to need to be at least over 0.5 to
00:09:16
get any results. Let's try around 0.75. This
really depends on the look you're going for,
00:09:23
and each image is going to be slightly different.
You're going to have to play with that as you
00:09:27
start generating it. Let's go ahead and generate
this and see what we start getting for results.
00:09:34
Okay, let's look at our images we have here.
These actually came out pretty decent. You can
00:09:42
see the letters do kind of follow some of the
contours. Now, some of these aren't going to
00:09:47
come out perfect, but we get a pretty good job.
I'm going to lower this down a little bit more.
00:09:58
I'm going to put that down closer to 0.7. Okay,
let's see if we can change this up a little bit
00:10:06
and get it a little more faded. A couple of
these actually, this one actually I thought
00:10:12
came out pretty good. At this point, let's
say we wanted that but didn't like the design;
00:10:17
we could in-paint just that area of it. Once
you get the text right, you can always work
00:10:22
around it. Let's go ahead and try another shot.
This came out halfway decent. Now you can adjust
00:10:31
the CPDS and other things to get better text.
You can also have it zoom in more if you want
00:10:37
to maintain that structure, especially if you
have smaller text. If you want to really go in,
00:10:43
you can zoom in even more similar to how I show
in my other video on how to do text. The biggest
00:10:49
thing here is going to be the denoising strength.
It's the big difference because to keep the shape
00:10:56
better so it looks more realistic, you need to
turn that down. If you turn it down too much,
00:11:02
then it also gets more difficult. The other thing
to keep in mind, which I didn't show here, but
00:11:06
this will work for more than just text. You could
include images to help guide it, logos, whatever
00:11:15
you want. That's entirely up to you how you do it.
This just gives you the basic idea of how to get
00:11:21
that. Obviously, once you get the basic design,
you can then go from there and in-paint it.
00:11:28
Now, I will mention one thing you might want to
do. If you're going to be upscaling your images,
00:11:32
you can upscale them first and then do this
because you'll be working with a smaller area
00:11:38
when you do the in-painting and that respective
field. You can do that with an upscaled image
00:11:44
as well. Okay, so I've decided let's go ahead
and do an upscaled image. I've got this image
00:11:51
here I generated. It's going to be a little bit
tougher because it's further back. That would
00:11:59
normally be very difficult if you try doing
it under the normal image prompts without
00:12:04
adjusting things because your text would
be so small that it wouldn't maintain the
00:12:09
structure. But we shouldn't have that issue
because we want to do the same technique.
00:12:15
I've gone ahead and already masked the area,
got that out of the way. In the image prompt,
00:12:19
I've changed things a little bit. I've put the
robot and everything right on that image. That
00:12:25
way I can get more influence. I'm going to
increase the weight a little bit. The stop
00:12:29
value in the image prompt just for the
style, the look, and everything to help
00:12:33
influence that result. The prompt is all set.
I've got the in-paint denoising strength set.
00:12:39
Let's go a little bit lower on that. I've measured
everything out, so this should work. Like I said,
00:12:50
this has been upscaled. This is already an
upscaled image. Don't worry if the eyes are weird.
00:12:55
I didn't work on any of that yet. I usually do
that after the fact. Let's go ahead and do this.
00:13:02
Looking at these four, I'd say overall they're not
too bad. This one didn't get the text right, but
00:13:09
this is a perfect example. Let's say you did like
this but just the text part at the bottom. You
00:13:14
could just start and mask that area, remeasure,
and figure it out from there. Just continue. This
00:13:24
one didn't come out that good. This one's not too
bad. I actually like this one the most. What I
00:13:35
would normally do at this point is, I would mask
this area to remove the text I don't want. This
00:13:59
one, I am perfectly fine with that text. We'll
clear this out. I'm going to get rid of these
00:14:04
things now because let's say I just want to
finish touching those things up. I'm going to
00:14:18
change the denoising strength now because I don't
want that to influence generation. Put that in
00:14:33
there. I think we're good to go. Let's give this
a shot. So, we've got a couple of images. This
00:14:42
one's fine. Now we have our images. I'll give
you a couple of bonuses. This should give you a
00:14:49
good idea of how to get to this point. I didn't do
many image generations; I just wanted to show the
00:14:56
technique. This gets a lot easier if you're not
trying to do it on images like the ones I'm using
00:15:03
that are dirty and worn out. If you're putting
it on somebody that's got a smoother shirt,
00:15:12
it gets easier to get a better result. But I
wanted to show the more difficult situations.
00:15:20
Now, if you really want to take that to
the next level and make it look phenomenal,
00:15:24
you can use Magnific AI. This does cost a bit of
money unless you do a lot of upscaling and want
00:15:32
a lot of detail. I don't necessarily recommend it,
but if you're using it enough, it is worth it. The
00:15:38
first one I'm going to do is the one I just did.
I'm going to put my prompt in here. Let's go with
00:15:43
a scaling factor of two. I'm going to keep the
resemblance up. We're going to leave everything
00:15:50
else fine. Let's go with that. We're going to
go ahead and upscale that. If you're wondering,
00:15:58
as I mentioned before, about getting a design on
a shirt in GIMP, I can show you how to do that.
00:16:07
Let's see if I can remember how to do this.
Open as a layer. Let's scale this down. I'm
00:16:26
not going to go for perfection here. At this
point, you could rotate it or anything like
00:16:33
that. I'm not going to worry about that right
now. Then I'm just going to change this. If
00:16:40
we go down to the mode on that layer, and
you can try different ones, but usually,
00:16:46
I find overlay works pretty good. There we go.
This shirt doesn't look perfect, and you can
00:17:00
lower the opacity as well. That helps it blend
in. There's a lot of little tweaks you can do,
00:17:06
but that's pretty much how you would do it in
GIMP. You could change to other modes. Soft
00:17:14
light will do it as well. Play around
with different ones, and sometimes it
00:17:19
depends on the image. That's how you can do
something like that in GIMP if you want to.
00:17:26
Let's check our Magnific upscale. Here we go.
Now, it went a little extreme, but that one
00:17:36
actually came out really good. There we go. I
will say I really love Magnific; just wish it
00:17:48
wasn't so expensive. If you really want to up your
game, that's the way to do it. Well, that covers
00:17:53
everything for this video. As I said, it does take
a little tweaking and practice. It may not always
00:17:59
work with every image, but it is one of the better
ways I've found. If someone has a better way,
00:18:04
I'd love to hear it in the comments. I'm always
looking for improvements and better ways of doing
00:18:09
things. This is not limited to t-shirts and can
be used for other things as well. If you found
00:18:15
this video helpful, please hit the like button
so others may discover it as well. Thank you
00:18:19
to everyone who has donated to help the channel,
and thanks for watching. Now, have fun creating.