1 00:00:00,000 --> 00:00:02,320 All right, so this is Stable Diffusion. 2 00:00:02,320 --> 00:00:03,420 This is an AI? 3 00:00:03,420 --> 00:00:05,040 Yeah, this is Stable Diffusion. 4 00:00:05,040 --> 00:00:06,380 This is the AI? 5 00:00:06,380 --> 00:00:08,080 This is one of the AIs. 6 00:00:08,100 --> 00:00:09,280 And what's this one do? 7 00:00:09,280 --> 00:00:12,480 This is actually ControlNet bolted on top of Stable Diffusion. 8 00:00:12,480 --> 00:00:16,320 So you have, in this case, the Nike Swish. 9 00:00:16,480 --> 00:00:21,920 It's going to control the Stable Diffusion to generate a edge map right here. 10 00:00:21,920 --> 00:00:27,380 So you can get... this is how you get the images with certain patterns built into them. 11 00:00:27,380 --> 00:00:29,640 So have you seen the TikTok filters with people like... 12 00:00:29,640 --> 00:00:32,300 Dancing like a... they look like a... 13 00:00:32,300 --> 00:00:34,040 I totally do those videos. 14 00:00:34,040 --> 00:00:36,460 Yeah, this is how it's built. 15 00:00:36,460 --> 00:00:40,120 Okay, so it does the edging around it and then it can do things around it. 16 00:00:40,480 --> 00: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. 17 00:00:45,920 --> 00:00:47,520 There's all sorts of different ways of doing it. 18 00:00:47,520 --> 00:00:50,800 Do you always have to feed an image in or can you also do text in? 19 00:00:50,800 --> 00:00:52,360 This is a text image. 20 00:00:52,360 --> 00:00:59,400 So this is a human baby lobster, but we can do it with this image or this... various other images. 21 00:00:59,640 --> 00:01:00,660 Okay. 22 00:01:00,820 --> 00:01:04,040 If you don't feed it an image, are you able to just generate something? 23 00:01:04,040 --> 00:01:08,540 It's going to see what happens with human baby lobster without an image fed into it. 24 00:01:08,540 --> 00:01:10,140 This one's still got the Nike Switch. 25 00:01:10,140 --> 00:01:12,380 I haven't swapped it over. 26 00:01:14,500 --> 00:01:18,880 That is remarkably creepy for some of these. 27 00:01:18,900 --> 00:01:22,840 Yeah, this one has improved drastically since we did this last year. 28 00:01:22,840 --> 00: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. 29 00:01:30,180 --> 00: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. 30 00:01:36,420 --> 00:01:37,200 Oh my gosh. 31 00:01:37,200 --> 00:01:40,680 Some of these are still like, they're really good. 32 00:01:40,680 --> 00:01:42,080 I like the ribs. 33 00:01:42,080 --> 00:01:44,860 Kind of nuts at the same time. 34 00:01:45,220 --> 00:01:51,350 So as a curiosity, the other item on the scav hunt list is crashing AI. 35 00:01:51,840 --> 00:01:52,660 Yeah, we can... 36 00:01:52,660 --> 00:01:54,400 How do you crash an AI? 37 00:01:54,400 --> 00:01:58,420 This particular one I crash usually by going too big. 38 00:01:59,300 --> 00:02:05,160 So this model was trained to do 512x512. 39 00:02:05,280 --> 00:02:09,400 So you're making the image way too big for it to process and it will crash. 40 00:02:09,400 --> 00:02:14,040 Oh, well this won't crash, but I want to turn off the control net stuff. 41 00:02:14,100 --> 00:02:15,680 And you're expecting this one to crash? 42 00:02:15,680 --> 00:02:19,840 No, this won't crash, but the model is going to start generating some really weird stuff. 43 00:02:20,340 --> 00:02:22,900 But what happened is I pushed it up. 44 00:02:22,920 --> 00:02:28,580 Now it's consuming nearly 36 gigs, 36 gigabytes of VRAM. 45 00:02:28,760 --> 00:02:32,840 I have an A6000, so I have nearly 50 gigs of VRAM. 46 00:02:33,640 --> 00:02:36,520 But normally this would crash just out of memory. 47 00:02:36,560 --> 00:02:37,140 Okay. 48 00:02:37,140 --> 00:02:41,160 And if I pushed these numbers up a little bit higher, I would have crashed it without a memory. 49 00:02:41,160 --> 00:02:44,100 But what happens now is it's going to take 10 minutes to generate. 50 00:02:44,100 --> 00:02:48,060 But usually when you push it this high, you get a result. 51 00:02:48,060 --> 00: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. 52 00:02:56,280 --> 00: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. 53 00:03:04,260 --> 00: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. 54 00:03:15,340 --> 00: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. 55 00:03:23,340 --> 00:03:24,600 And what causes it? 56 00:03:24,600 --> 00:03:27,540 Okay, maybe it's not a crash, but what causes it to go goofy? 57 00:03:27,540 --> 00: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? 58 00:03:32,920 --> 00:03:35,240 The model was trained to generate 512x512. 59 00:03:35,240 --> 00:03:41,740 So in this case, the model was trained to generate 256x256 images, and then upscale that to 512x512. 60 00:03:41,760 --> 00:03:44,280 And the upscaling is literally like CSI Enhanced. 61 00:03:44,280 --> 00:03:46,600 That's what it is, just CSI Enhanced. 62 00:03:46,600 --> 00:03:51,560 I feel like every time I use CSI Enhanced, I do have to, in a deep voice, go, Enhanced. 63 00:03:51,560 --> 00:03:57,060 Yeah, this parameter right here is saying, oh, we're going to do Enhanced 30 times. 64 00:03:58,280 --> 00:03:59,900 But it does the upscaling. 65 00:04:00,540 --> 00: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. 66 00:04:06,520 --> 00:04:12,140 And so it's going to make the same, it just tiles that process over and over again. 67 00:04:12,140 --> 00: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. 68 00:04:16,380 --> 00:04:20,840 And they overlap, so you get a horse, so the horses meld together. 69 00:04:20,840 --> 00: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? 70 00:04:27,660 --> 00: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, 71 00:04:44,140 --> 00:04:46,800 and then generates another finger, and then it just keeps going. 72 00:04:46,800 --> 00:04:51,620 And it just accidentally makes six fingers, because it knows how to generate small patches. 73 00:04:51,620 --> 00:04:53,660 But it's got the same thing. 74 00:04:53,840 --> 00:04:56,640 I think you're right, but I'm not sure. 75 00:04:56,640 --> 00:05:03,500 Because I do ML security with malware models, and spam, and all sorts of other weird things. 76 00:05:03,500 --> 00:05:09,360 So let's answer the question for Scav Hunt, which is, how do you crash AI? 77 00:05:09,960 --> 00:05:15,620 Well, in this case, if you want to crash stable diffusion, you can allocate way too much RAM. 78 00:05:15,740 --> 00:05:19,760 Most of the time I crash AI, it's out of memory. 79 00:05:21,300 --> 00: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. 80 00:05:33,560 --> 00:05:37,520 So is that what happens when you get too many tokens, it loses the original con? 81 00:05:37,520 --> 00:05:38,580 It does one of two things. 82 00:05:38,580 --> 00:05:43,920 Either A, it loses the original context, and this is one of the ways a lot of jailbreaks work, right? 83 00:05:43,920 --> 00: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. 84 00:05:51,360 --> 00: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. 85 00:06:03,960 --> 00:06:06,360 You either have the option of losing context, or... 86 00:06:06,360 --> 00:06:07,760 You start running out of memory. 87 00:06:07,760 --> 00:06:10,420 You run out of memory, and it officially crashes the process. 88 00:06:10,420 --> 00:06:13,380 Yeah, but they control the number of tokens. 89 00:06:13,600 --> 00:06:18,020 That's why Anthropic was so excited about beginning to 10,000 tokens. 90 00:06:18,440 --> 00: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. 91 00:06:25,540 --> 00:06:26,120 Okay. 92 00:06:26,680 --> 00:06:31,020 So with this then, first, thank you for teaching me how to crash AI. 93 00:06:31,020 --> 00:06:33,640 I have that now, that feather in my cap. 94 00:06:33,640 --> 00:06:35,000 Thank you so much for your time. 95 00:06:35,000 --> 00:06:36,820 I really, really appreciate it. 96 00:06:36,820 --> 00:06:37,820 Thank you for watching. 97 00:06:37,820 --> 00:06:40,060 And as always, hack on. 98 00:06:40,280 --> 00:06:44,220 That is super hot right now. 99 00:06:44,220 --> 00:06:46,680 And if it doesn't crash, it might catch fire.