WEBVTT

00:00.000 --> 00:02.320
All right, so this is Stable Diffusion.

00:02.320 --> 00:03.420
This is an AI?

00:03.420 --> 00:05.040
Yeah, this is Stable Diffusion.

00:05.040 --> 00:06.380
This is the AI?

00:06.380 --> 00:08.080
This is one of the AIs.

00:08.100 --> 00:09.280
And what's this one do?

00:09.280 --> 00:12.480
This is actually ControlNet bolted on top of Stable Diffusion.

00:12.480 --> 00:16.320
So you have, in this case, the Nike Swish.

00:16.480 --> 00:21.920
It's going to control the Stable Diffusion to generate a edge map right here.

00:21.920 --> 00:27.380
So you can get... this is how you get the images with certain patterns built into them.

00:27.380 --> 00:29.640
So have you seen the TikTok filters with people like...

00:29.640 --> 00:32.300
Dancing like a... they look like a...

00:32.300 --> 00:34.040
I totally do those videos.

00:34.040 --> 00:36.460
Yeah, this is how it's built.

00:36.460 --> 00:40.120
Okay, so it does the edging around it and then it can do things around it.

00:40.480 --> 00:45.920
So this one does edging, but then you can do it with a normal map, you can do it with a pose map.

00:45.920 --> 00:47.520
There's all sorts of different ways of doing it.

00:47.520 --> 00:50.800
Do you always have to feed an image in or can you also do text in?

00:50.800 --> 00:52.360
This is a text image.

00:52.360 --> 00:59.400
So this is a human baby lobster, but we can do it with this image or this... various other images.

00:59.640 --> 01:00.660
Okay.

01:00.820 --> 01:04.040
If you don't feed it an image, are you able to just generate something?

01:04.040 --> 01:08.540
It's going to see what happens with human baby lobster without an image fed into it.

01:08.540 --> 01:10.140
This one's still got the Nike Switch.

01:10.140 --> 01:12.380
I haven't swapped it over.

01:14.500 --> 01:18.880
That is remarkably creepy for some of these.

01:18.900 --> 01:22.840
Yeah, this one has improved drastically since we did this last year.

01:22.840 --> 01:30.140
We had Latent Diffusion and if you asked it to generate an image like this, it would generate like outer nightmare fuel.

01:30.180 --> 01:36.420
I think I have some nightmare fuel on this computer, but it was like the most disgusting tentacle monster we've ever seen.

01:36.420 --> 01:37.200
Oh my gosh.

01:37.200 --> 01:40.680
Some of these are still like, they're really good.

01:40.680 --> 01:42.080
I like the ribs.

01:42.080 --> 01:44.860
Kind of nuts at the same time.

01:45.220 --> 01:51.350
So as a curiosity, the other item on the scav hunt list is crashing AI.

01:51.840 --> 01:52.660
Yeah, we can...

01:52.660 --> 01:54.400
How do you crash an AI?

01:54.400 --> 01:58.420
This particular one I crash usually by going too big.

01:59.300 --> 02:05.160
So this model was trained to do 512x512.

02:05.280 --> 02:09.400
So you're making the image way too big for it to process and it will crash.

02:09.400 --> 02:14.040
Oh, well this won't crash, but I want to turn off the control net stuff.

02:14.100 --> 02:15.680
And you're expecting this one to crash?

02:15.680 --> 02:19.840
No, this won't crash, but the model is going to start generating some really weird stuff.

02:20.340 --> 02:22.900
But what happened is I pushed it up.

02:22.920 --> 02:28.580
Now it's consuming nearly 36 gigs, 36 gigabytes of VRAM.

02:28.760 --> 02:32.840
I have an A6000, so I have nearly 50 gigs of VRAM.

02:33.640 --> 02:36.520
But normally this would crash just out of memory.

02:36.560 --> 02:37.140
Okay.

02:37.140 --> 02:41.160
And if I pushed these numbers up a little bit higher, I would have crashed it without a memory.

02:41.160 --> 02:44.100
But what happens now is it's going to take 10 minutes to generate.

02:44.100 --> 02:48.060
But usually when you push it this high, you get a result.

02:48.060 --> 02:56.280
So it doesn't crash crash, but because I've pushed the image range so high, it doesn't generate a sensible image anymore.

02:56.280 --> 03:04.080
So if you want a horse with eight legs, and you want to guarantee a horse with eight legs, you push the image resolution too high.

03:04.260 --> 03:15.340
And then it will generate horses with eight legs and all sorts of fun things that you don't get when you generate normal images on Hugging Face or Dali 2.

03:15.340 --> 03:23.340
Because they want you to get good images that are usable, and I'm trying to currently push an image that's through this thing that is just going to break the system.

03:23.340 --> 03:24.600
And what causes it?

03:24.600 --> 03:27.540
Okay, maybe it's not a crash, but what causes it to go goofy?

03:27.540 --> 03:32.920
It's that it runs out of memory, so in an attempt to save memory, it's like offloading, and what's happening?

03:32.920 --> 03:35.240
The model was trained to generate 512x512.

03:35.240 --> 03:41.740
So in this case, the model was trained to generate 256x256 images, and then upscale that to 512x512.

03:41.760 --> 03:44.280
And the upscaling is literally like CSI Enhanced.

03:44.280 --> 03:46.600
That's what it is, just CSI Enhanced.

03:46.600 --> 03:51.560
I feel like every time I use CSI Enhanced, I do have to, in a deep voice, go, Enhanced.

03:51.560 --> 03:57.060
Yeah, this parameter right here is saying, oh, we're going to do Enhanced 30 times.

03:58.280 --> 03:59.900
But it does the upscaling.

04:00.540 --> 04:06.260
But what it was trained to do is have that field of view, and so suddenly you have given it this field of view.

04:06.520 --> 04:12.140
And so it's going to make the same, it just tiles that process over and over again.

04:12.140 --> 04:16.380
So it's going to try to generate a horse here, and then it's going to go over here and try to generate a horse.

04:16.380 --> 04:20.840
And they overlap, so you get a horse, so the horses meld together.

04:20.840 --> 04:27.660
Is this one of the reasons why some of the early things with stable diffusion made people look so weird, or is that a separate problem?

04:27.660 --> 04:44.140
I don't actually know myself, but one of the creators is around, I don't think she's here right now, but like that particular thing, I think was a, basically that story of like, I'm going to generate one set of finger, it knows how to generate a finger,

04:44.140 --> 04:46.800
and then generates another finger, and then it just keeps going.

04:46.800 --> 04:51.620
And it just accidentally makes six fingers, because it knows how to generate small patches.

04:51.620 --> 04:53.660
But it's got the same thing.

04:53.840 --> 04:56.640
I think you're right, but I'm not sure.

04:56.640 --> 05:03.500
Because I do ML security with malware models, and spam, and all sorts of other weird things.

05:03.500 --> 05:09.360
So let's answer the question for Scav Hunt, which is, how do you crash AI?

05:09.960 --> 05:15.620
Well, in this case, if you want to crash stable diffusion, you can allocate way too much RAM.

05:15.740 --> 05:19.760
Most of the time I crash AI, it's out of memory.

05:21.300 --> 05:33.560
With a large language model, the number of tokens, the number of tokens, the amount of memory you need scales with the square of the number of tokens, and that is bad.

05:33.560 --> 05:37.520
So is that what happens when you get too many tokens, it loses the original con?

05:37.520 --> 05:38.580
It does one of two things.

05:38.580 --> 05:43.920
Either A, it loses the original context, and this is one of the ways a lot of jailbreaks work, right?

05:43.920 --> 05:51.340
Where it fills up the context, it forgets about its original security parameters, and now it's doing things it's really not supposed to do.

05:51.360 --> 06:03.900
Like the invention of a lot of the jailbreaks, where you can now, all of a sudden, recipes for drinking bleach and things like that, where it's saying things you're definitely not supposed to do as recipes.

06:03.960 --> 06:06.360
You either have the option of losing context, or...

06:06.360 --> 06:07.760
You start running out of memory.

06:07.760 --> 06:10.420
You run out of memory, and it officially crashes the process.

06:10.420 --> 06:13.380
Yeah, but they control the number of tokens.

06:13.600 --> 06:18.020
That's why Anthropic was so excited about beginning to 10,000 tokens.

06:18.440 --> 06:25.540
They came up with a new way of doing it to drastically expand the amount of tokens without messing with the memory too much.

06:25.540 --> 06:26.120
Okay.

06:26.680 --> 06:31.020
So with this then, first, thank you for teaching me how to crash AI.

06:31.020 --> 06:33.640
I have that now, that feather in my cap.

06:33.640 --> 06:35.000
Thank you so much for your time.

06:35.000 --> 06:36.820
I really, really appreciate it.

06:36.820 --> 06:37.820
Thank you for watching.

06:37.820 --> 06:40.060
And as always, hack on.

06:40.280 --> 06:44.220
That is super hot right now.

06:44.220 --> 06:46.680
And if it doesn't crash, it might catch fire.

