00:00 - 00:04
three of my very favorite things are un
00:02 - 00:08
sampling Regional prompting and
00:04 - 00:10
perturbed attention guidance amazingly
00:08 - 00:13
thanks to recent updates in the flux
00:10 - 00:16
depos repo for comy UI we get all three
00:13 - 00:18
at once in my earlier videos we've
00:16 - 00:21
already seen the previous rectified flow
00:18 - 00:25
inversion type of amping but there's a
00:21 - 00:28
new kid on the Block in the form of RF
00:25 - 00:30
edit there it is RF solver edit Regional
00:28 - 00:33
prompting allows you to use area
00:30 - 00:36
specific prompting for extra fun in
00:33 - 00:38
their example they've got a UFO and then
00:36 - 00:40
on the left they got some snow and ice
00:38 - 00:43
and stuff and over on the right lots of
00:40 - 00:46
fire so nicely contrasting there but of
00:43 - 00:48
course you could mix other areas maybe
00:46 - 00:51
top and bottom for a head and body
00:48 - 00:53
combination or whatever type of masking
00:51 - 00:56
your heart desires let your imagination
00:53 - 00:58
just consider all those options for a
00:56 - 01:01
moment done great because there's even
00:58 - 01:03
more remember the perturbed attention
01:01 - 01:06
guidance for stable diffusion and wish
01:03 - 01:08
you had that in flux well now you do and
01:06 - 01:10
it seems to work just fine and dandy if
01:08 - 01:12
you're not sure what all those long
01:10 - 01:14
words mean they've added pictures to
01:12 - 01:16
help clear the brain fog away there we
01:14 - 01:20
can see all the lovely details with the
01:16 - 01:23
vanilla the p and the seg images all of
01:20 - 01:25
this you can do at home for free on your
01:23 - 01:28
own computer ideally something with an
01:25 - 01:31
Nvidia card for the best compatibility
01:28 - 01:33
you'll need Comfy your installed and the
01:31 - 01:36
flux depos nodes can be installed using
01:33 - 01:39
comfy UI manager I will be using other
01:36 - 01:42
custom nodes too so be sure to check the
01:39 - 01:44
badges shown on each node to see where
01:42 - 01:47
they come from with a little fox icon
01:44 - 01:49
indicating it's built in to comy UI if
01:47 - 01:51
you are a comy UI beginner I'd suggest
01:49 - 01:54
starting out with the basics first with
01:51 - 01:57
the links in the video description okay
01:54 - 02:00
then let's dive into the first workflow
01:57 - 02:02
which is for RF edit I've made a few few
02:00 - 02:04
minor changes to their example just
02:02 - 02:08
because I love colors and slapping clip
02:04 - 02:10
onto the CPU saves a bunch of vram I'm
02:08 - 02:12
also starting off with adding a hyper
02:10 - 02:14
Laura because that's how I roll plus I
02:12 - 02:17
wanted to see if it would still work
02:14 - 02:19
with a low step count to first of all it
02:17 - 02:21
needs to make some noise and for this
02:19 - 02:23
part you don't need a prompt then a
02:21 - 02:26
massive eight steps here with the
02:23 - 02:29
re-edit forward sampler and there we go
02:26 - 02:31
it's created some noise once we've got
02:29 - 02:33
our noise it's time to prompt for the
02:31 - 02:36
changes and in this case I'm looking to
02:33 - 02:39
make a guy out of colorful patterns
02:36 - 02:42
hopefully something like the input image
02:39 - 02:46
now the RF edit reverse sampler has a
02:42 - 02:49
setting for inject steps with more steps
02:46 - 02:51
making the result closer to the original
02:49 - 02:53
image if you want to make fairly drastic
02:51 - 02:56
changes to something such as change the
02:53 - 02:59
entire style then lowering those
02:56 - 03:01
injected steps can help in this case I'm
02:59 - 03:04
using hyper so two steps is actually
03:01 - 03:06
quite a lot given the total number is
03:04 - 03:08
just eight what does it come out like
03:06 - 03:10
then does it work with turbo and stuff
03:08 - 03:12
let's scroll over and have a look well I
03:10 - 03:14
think it's turned out nicely you can
03:12 - 03:17
certainly get the sense of the original
03:14 - 03:20
but it's made all that artistic stuff
03:17 - 03:22
exactly how I wanted sweet one thing to
03:20 - 03:24
bear in mind though is that
03:22 - 03:26
unfortunately this sampler runs at half
03:24 - 03:29
the speed you're probably used to in my
03:26 - 03:32
case it was 2.6 seconds per iteration
03:29 - 03:34
instead of the usual 1.3 if you're used
03:32 - 03:37
to using a negative prompt with flux
03:34 - 03:40
then it's about that same sort of speed
03:37 - 03:43
I guess with great power comes uh longer
03:40 - 03:45
generation times anyway no lwas this
03:43 - 03:48
time and now I want to turn my dude here
03:45 - 03:50
into a more anime art style image first
03:48 - 03:53
of all we generate the noise I've got 20
03:50 - 03:55
steps there now I've got the prompt and
03:53 - 03:57
anime art style illustration of a happy
03:55 - 03:58
nerdy bearded hipster dude wearing a
03:57 - 04:01
willly hat who was sitting on a round
03:58 - 04:03
table next to him is a small camera this
04:01 - 04:06
time I'm injecting four steps basic
04:03 - 04:08
scheduler simple 20 steps total and
04:06 - 04:10
there we go once again we can compare
04:08 - 04:12
the images so there's the input image
04:10 - 04:14
and the final result I think that's
04:12 - 04:16
that's very good indeed you can also
04:14 - 04:19
make more subtle edits this time I've
04:16 - 04:22
got my shocked rodent going through
04:19 - 04:24
making the noise as normal and for my
04:22 - 04:26
prompt I'm going with something very
04:24 - 04:29
similar to the actual image only I'm
04:26 - 04:31
changing the portraits and his clothing
04:29 - 04:34
with four or injection steps that should
04:31 - 04:37
give us a decent amount of change and
04:34 - 04:38
there he is all right very nice indeed
04:37 - 04:40
we've got the portraits in the
04:38 - 04:43
background which are now of rodents
04:40 - 04:46
rather than these other posters and he's
04:43 - 04:48
wearing a jacket which is very handy cuz
04:46 - 04:50
I've sort of got this weird tail here
04:48 - 04:53
which isn't really where Tails should be
04:50 - 04:57
so that's that's nicely repaired that
04:53 - 04:59
into the jacket very cool being RF edit
04:57 - 05:01
even if you make changes to your prompt
04:59 - 05:03
you can still get some reasonably
05:01 - 05:06
similar outputs first up here is the
05:03 - 05:07
prompt we just saw the one with a jacket
05:06 - 05:10
and here I'm changing it to a red and
05:07 - 05:13
black squared jacket then he's got
05:10 - 05:15
Hawaiian shirt and a cane and finally
05:13 - 05:17
down the bottom I'm changing the shift
05:15 - 05:20
values a bit to see how much things
05:17 - 05:22
alter okay let's zoom in see what's
05:20 - 05:24
going on here so same prompt as the
05:22 - 05:27
first one apart from he's got this red
05:24 - 05:30
and black squared patented Lumberjack
05:27 - 05:32
shirt on we can zoom in on these IM have
05:30 - 05:35
a compare so now I've mentioned the fur
05:32 - 05:37
he's got his shirt open once again that
05:35 - 05:40
sort of tail has been resolved now the
05:37 - 05:43
picture is similar but we've got a sun
05:40 - 05:46
up there whereas in this one it was sort
05:43 - 05:49
of like a weird TV areal so if we just
05:46 - 05:51
have a look at those two together we got
05:49 - 05:53
that one see the newspaper's quite
05:51 - 05:55
similar that's quite similar the picture
05:53 - 05:59
the other thing has changed anyway so if
05:55 - 06:01
we give him the cane and Hawaiian shirt
05:59 - 06:04
once again we've got other elements have
06:01 - 06:06
changed slightly but that picture is
06:04 - 06:09
fairly similar fairly similar the
06:06 - 06:10
newspaper little bit different little
06:09 - 06:13
bit different he's also got three toes
06:10 - 06:15
and four toes in there there we go and
06:13 - 06:17
here he is with the max shift so this
06:15 - 06:18
one I've changed the max shift value up
06:18 - 06:23
1.75 allowing the image to change even
06:21 - 06:26
more and of course his arm has gone way
06:23 - 06:29
out over here instead but it's still a
06:26 - 06:31
very good image so there we go RF edit
06:29 - 06:33
if you want to make edits to an image
06:31 - 06:35
all sorts of different things you can do
06:33 - 06:38
from the style or indeed changing
06:35 - 06:41
objects and things in your original
06:38 - 06:44
picture on to the regional prompting
06:41 - 06:46
then now just a note for this to work
06:44 - 06:49
you will have to start comfy UI without
06:46 - 06:53
X forers enabled you can do that by
06:49 - 06:56
adding the D- disabled DX forers option
06:53 - 06:58
when you start comfy UI normally you'd
06:56 - 07:00
just do python main.py but here I've
06:58 - 07:03
added the option minus minus disable
07:00 - 07:06
minus X forers if you do try to use x
07:03 - 07:09
forers then you'll go out of mana and
07:06 - 07:11
none of your healing spells will work oh
07:09 - 07:13
o doesn't mean out of Mana okay in in
07:11 - 07:17
this case you'll get an O message which
07:13 - 07:19
is still very bad taking a look at the
07:17 - 07:20
workflow once again I've added some
07:19 - 07:23
pretty colors but you should be able to
07:20 - 07:26
see at a glance what is going on here
07:23 - 07:29
the three masks at the top show the
07:26 - 07:31
three regions for the final image now
07:29 - 07:34
zooming in a bit here we can see those
07:31 - 07:37
masks are created by KJ nodes create
07:34 - 07:40
shape mask if you wanted to you could
07:37 - 07:42
draw your own mask or load any existing
07:40 - 07:45
ones you have this is just a way to
07:42 - 07:47
create one next up we've got the prompts
07:45 - 07:50
so there I've got a UFO the winter scene
07:47 - 07:53
and the fiery Forest then we've got
07:50 - 07:55
these Daisy chained create flux Regional
07:53 - 07:57
conditioning nodes so there we've got
07:55 - 07:59
the one the two and the three and
07:57 - 08:02
zooming in down here they finally up
07:59 - 08:04
with apply flux Regional conditioning
08:02 - 08:07
down here in the sampling it's a fairly
08:04 - 08:09
basic prompter photo with some cinematic
08:07 - 08:11
style and there we've got our UFO we got
08:09 - 08:13
the snow and we've got the fire as
08:11 - 08:16
mentioned in the right up four Regional
08:13 - 08:18
conditioning you can use Redux as well
08:16 - 08:21
and the node I'm using this time is from
08:18 - 08:24
Advanced Redux control the cool thing
08:21 - 08:27
about this one being you can use masks
08:24 - 08:29
there we go masked conditioning images
08:27 - 08:32
like you can see just a portion of the
08:29 - 08:34
input image has been selected and so the
08:32 - 08:37
pattern from there you can use on the
08:34 - 08:40
guy's shirt in your generation very nice
08:37 - 08:42
for this example of regional prompting
08:40 - 08:45
then I've simplified it down to just two
08:42 - 08:49
regions left and right but I've also
08:45 - 08:51
added that Redux Advanced node there no
08:49 - 08:53
masks as yet but I will look at that in
08:51 - 08:56
a moment for now it's just the full
08:53 - 08:59
image on the left and the full image on
08:56 - 09:01
the right there are two strength options
08:59 - 09:04
for the the node downsampling factor and
09:01 - 09:05
weight the weight is like the
09:04 - 09:08
conditioning average option I showed in
09:05 - 09:10
my previous video with the down sampling
09:08 - 09:13
Factor being another way of doing much
09:10 - 09:15
the same thing only more betterer the
09:13 - 09:18
higher the down sampling Factor the
09:15 - 09:21
weaker the impact will be with nine
09:18 - 09:22
being almost no impact at all in this
09:21 - 09:25
case though I've got them both on
09:22 - 09:28
maximum but I've just dropped the weight
09:25 - 09:30
a little bit on the first node you'll
09:28 - 09:32
probably also have noticed that to start
09:30 - 09:34
with I'm not using any prompts with all
09:32 - 09:36
of them being empty I think the
09:34 - 09:39
resulting image is rather good and
09:36 - 09:41
personally I could sit here all day
09:39 - 09:44
making half and half face images I'll
09:41 - 09:46
show you P again in a moment but it's
09:44 - 09:48
worth noting here that it does seem to
09:46 - 09:52
work nicely in this scenario it's the
09:48 - 09:54
node down here apply flux p a attention
09:52 - 09:57
I think it helps to make the two Styles
09:54 - 10:00
a bit more distinct with mid-range down
09:57 - 10:02
sampling factors two and three in this
10:00 - 10:05
case things get a bit more freedom
10:02 - 10:07
though it can be sort of a balancing act
10:05 - 10:10
to get the strength right for the exact
10:07 - 10:12
result you like of course it doesn't
10:10 - 10:14
have to be left and right like in this
10:12 - 10:16
example I've gone for top and bottom
10:14 - 10:19
instead this time I also have a main
10:16 - 10:21
prompt where I'm asking for a cinematic
10:19 - 10:24
style and a cybernetic woman with the
10:21 - 10:27
downsampling factors there of three and
10:24 - 10:29
two that does allow the prompt to work a
10:27 - 10:32
little bit otherwise it wouldn't be able
10:29 - 10:35
to manage as mentioned you can use masks
10:32 - 10:38
with the advanced Redux control node as
10:35 - 10:41
well now if you're using a mask don't
10:38 - 10:43
forget to connect that mask in and if
10:41 - 10:46
you're not using a mask don't forget to
10:43 - 10:49
disconnect it now here I'm slightly lazy
10:46 - 10:51
and I'm using a simple mask by text node
10:49 - 10:53
so down here I'm saying I want to
10:51 - 10:55
identify the clothing I don't want the
10:53 - 10:57
background Precision Point 43 because
10:55 - 10:59
why not and there you go essentially
10:57 - 11:02
that does the masking for
10:59 - 11:05
rather than me having to rightclick open
11:02 - 11:07
in mask editor do all the things there
11:05 - 11:10
save to node so yeah just a a quick and
11:07 - 11:13
easy way to do a mask for this example
11:10 - 11:16
all right let's get back to it now it's
11:13 - 11:18
also worth noting when you do Ed a
11:16 - 11:21
masked area you'll also be lowering the
11:18 - 11:24
strength of that Redux Advanced node a
11:21 - 11:26
little bit so you may have to adjust
11:24 - 11:28
things accordingly now here you should
11:26 - 11:30
be able to see that despite my prompt
11:28 - 11:33
being the same as last time with a
11:30 - 11:36
downsampling factor there of one that is
11:33 - 11:39
essentially overriding everything else
11:36 - 11:41
with regards to style still it did make
11:39 - 11:43
a very cool image there it's got that
11:41 - 11:45
head it's got the drawing style added
11:43 - 11:48
the jacket it certainly got the the
11:45 - 11:51
vshape on there all right not bad if you
11:48 - 11:54
do want things to change as mentioned a
11:51 - 11:55
downsampling factor of about three is
11:54 - 11:58
average and that's what I'm using for
11:55 - 12:00
both areas in this example same prompt
11:58 - 12:03
again and this time it works and we're
12:00 - 12:05
back to a more photographic style image
12:03 - 12:08
which retains the general features of
12:05 - 12:10
both the images I've input we had a
12:08 - 12:13
quick look at it a moment ago but here
12:10 - 12:17
are p a perturbed detention guidance and
12:13 - 12:19
seeg smoothed energy guidance in action
12:17 - 12:22
using a really basic
12:19 - 12:24
workflow I've got eight-step hyperflux
12:22 - 12:27
because why not and for the prompt I
12:24 - 12:29
want a weird sort of spider cat with one
12:27 - 12:31
red eye and one blue eye the back ground
12:29 - 12:33
should be an ancient castle and the
12:31 - 12:35
style photographic all right we've had a
12:33 - 12:36
quick look at them already we've got the
12:35 - 12:40
first one up here which is just your
12:36 - 12:43
generic standard flux Generation all
12:40 - 12:46
right not not a bad spider cat it's okay
12:43 - 12:48
but what can we do with pag and seg well
12:46 - 12:50
this is what we can do with pag and seg
12:48 - 12:53
so pag is my personal favorite and I
12:50 - 12:55
think it adds a lot more detail starts
12:53 - 12:57
to follow the prompt a little bit better
12:55 - 13:00
notice how we've got the two different
12:57 - 13:02
colored eyes there now with seg I
13:00 - 13:04
couldn't quite get it to add as much
13:02 - 13:06
detail you see specifically on the
13:04 - 13:08
ground there but it is following the
13:06 - 13:11
prompt a little bit better because it's
13:08 - 13:13
got the two different colored eyes
13:11 - 13:16
whereas the standard one doesn't so not
13:13 - 13:19
entirely sure about seg myself here I've
13:16 - 13:22
changed the scale to four and the blur
13:19 - 13:24
to nine the lower you put the blur the
13:22 - 13:26
more like the original image it looks
13:24 - 13:28
like so if I put that all the way down
13:26 - 13:31
to blur one that's probably almost going
13:28 - 13:33
to be identical now with the pag the
13:31 - 13:35
perturbed detention guidance again I've
13:33 - 13:38
changed the scale here because I found
13:35 - 13:40
that at three it was burning slightly
13:38 - 13:44
all those colors were getting a bit so
13:40 - 13:46
scale 1.75 in this case seemed well a
13:44 - 13:48
lot better there that one's finished so
13:46 - 13:51
now we haven't got the two different
13:48 - 13:54
colored eyes and it is a little bit more
13:51 - 13:55
similar to the original image and yes
13:54 - 13:58
even if you're using other ways to
13:55 - 14:00
generate extra details slapping a pack
13:58 - 14:03
node in there can help follow that
14:00 - 14:05
prompt just a little bit even with low
14:03 - 14:07
values of course these are just a few
14:05 - 14:09
examples of what you can do with these
14:07 - 14:11
flux toos nodes and I'd love to hear
14:09 - 14:13
about all the ideas you come up with
14:11 - 14:15
down in the comments section rodent's
14:13 - 14:18
out for now and do have an incredible
14:15 - 14:21
amount of fun o nerdy
14:18 - 14:24
rodent he really makes my
14:21 - 14:30
day showing us
14:24 - 14:30
AI in a really British way