[00:00.000 --> 00:03.420] All right, so this is Stable Diffusion. 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:43.460] So this one does edging, but then you can do it with a normal map, [00:43.460 --> 00:47.520] you can do it with a pose map. 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:54.540] This is a text image. So this is a human baby lobster, [00:55.120 --> 00:59.400] but we can do it with this image or this... various other images. [00:59.640 --> 01:04.040] Okay. 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:12.380] This one's still got the Nike Switch. 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:27.340] We had Latent Diffusion and if you asked it to generate an image like this, [01:27.340 --> 01:32.600] it would generate like outer nightmare fuel. I think I have some nightmare fuel on this computer, [01:32.600 --> 01:36.420] but it was like the most disgusting tentacle monster we've ever seen. [01:36.420 --> 01:40.680] Oh my gosh. 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:39.560] And if I pushed these numbers up a little bit higher, [02:39.560 --> 02:41.160] 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:53.500] So it doesn't crash crash, but because I've pushed the image range so high, [02:53.500 --> 02:56.280] it doesn't generate a sensible image anymore. [02:56.280 --> 02:58.240] So if you want a horse with eight legs, [02:58.240 --> 03:00.420] and you want to guarantee a horse with eight legs, [03:00.420 --> 03:04.080] you push the image resolution too high. [03:04.260 --> 03:08.440] And then it will generate horses with eight legs and all sorts of fun things [03:08.440 --> 03:15.340] that you don't get when you generate normal images on Hugging Face or Dali 2. [03:15.340 --> 03:18.700] Because they want you to get good images that are usable, [03:18.700 --> 03:20.720] and I'm trying to currently push an image that's [03:20.720 --> 03:23.340] through this thing that is just going to break the system. [03:23.340 --> 03:27.540] And what causes it? Okay, maybe it's not a crash, but what causes it to go goofy? [03:27.540 --> 03:30.880] It's that it runs out of memory, so in an attempt to save memory, [03:30.880 --> 03:32.920] 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:39.360] So in this case, the model was trained to generate 256x256 images, [03:39.360 --> 03:41.740] 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:03.860] But what it was trained to do is have that field of view, [04:03.860 --> 04:06.260] 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:14.080] So it's going to try to generate a horse here, [04:14.080 --> 04:16.380] 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:24.540] Is this one of the reasons why some of the early things with stable diffusion [04:24.540 --> 04:27.660] made people look so weird, or is that a separate problem? [04:27.660 --> 04:34.100] I don't actually know myself, but one of the creators is around, [04:34.100 --> 04:39.580] I don't think she's here right now, but like that particular thing, I think was a, [04:39.580 --> 04:42.660] basically that story of like, I'm going to generate one set of finger, [04:42.660 --> 04:45.240] it knows how to generate a finger, and then generates another finger, [04:45.240 --> 04:49.200] and then it just keeps going. And it just accidentally makes six fingers, [04:49.200 --> 04:53.660] because it knows how to generate small patches. But it's got the same thing. [04:53.840 --> 05:00.940] I think you're right, but I'm not sure. Because I do ML security with malware models, [05:00.940 --> 05:03.500] 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:27.920] With a large language model, the number of tokens, the number of tokens, [05:27.920 --> 05:33.560] 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:41.320] It does one of two things. Either A, it loses the original context, [05:41.320 --> 05:43.920] and this is one of the ways a lot of jailbreaks work, right? [05:43.920 --> 05:48.620] Where it fills up the context, it forgets about its original security parameters, [05:48.620 --> 05:51.340] and now it's doing things it's really not supposed to do. [05:51.360 --> 05:57.240] Like the invention of a lot of the jailbreaks, where you can now, all of a sudden, recipes [05:57.240 --> 06:01.180] for drinking bleach and things like that, where it's saying things you're definitely [06:01.180 --> 06:06.360] not supposed to do as recipes. 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:14.340] Yeah, but they control the number of tokens. That's why [06:15.180 --> 06:18.020] Anthropic was so excited about beginning to 10,000 tokens. [06:18.440 --> 06:23.700] They came up with a new way of doing it to drastically expand the amount of tokens [06:23.700 --> 06:25.540] without messing with the memory too much. [06:25.540 --> 06:31.020] Okay. So with this then, first, thank you for teaching me how to crash AI. [06:31.020 --> 06:35.000] I have that now, that feather in my cap. Thank you so much for your time. [06:35.000 --> 06:40.060] I really, really appreciate it. Thank you for watching. And as always, hack on. [06:40.280 --> 06:46.680] That is super hot right now. And if it doesn't crash, it might catch fire.