WEBVTT

00:01.560 --> 00:05.920
I just want to show you a quick way to install Gradio.

00:05.960 --> 00:11.440
Get that running so that you can do image masks, because it's something that comes up quite a bit.

00:11.480 --> 00:14.000
So I just have this code that you can use.

00:14.120 --> 00:20.160
Just import gradio and numpy and pil from image and then nest async here.

00:20.440 --> 00:23.080
And then we create a mask this way.

00:23.080 --> 00:30.920
This is going to take basically the the colors that you put on in the gradio block.

00:31.080 --> 00:34.200
And then turn it into a black and white image for you.

00:34.440 --> 00:36.760
So super simple code.

00:36.760 --> 00:41.680
You don't need to worry too much about how it works, but this basically just creates an input for you

00:41.800 --> 00:43.840
in order to draw on the image.

00:44.120 --> 00:45.840
Gradio is like a really simple.

00:46.400 --> 00:51.400
You can think about it that way and it has a button, so it's running on a local URL, or you can see

00:51.400 --> 00:52.720
it running here locally.

00:52.880 --> 00:58.600
If you want to create an image mask that just gets rid of all the head, then you could do that.

00:59.160 --> 01:02.280
And then you just hit generate mask.

01:03.160 --> 01:09.080
And then it's got a white image with a black background that matches exactly this.

01:09.080 --> 01:16.040
And you can then download that and use that mask when you're doing image generation with inpainting.

01:16.040 --> 01:17.560
So that's where it's most useful.

01:18.160 --> 01:18.400
All right.

01:18.440 --> 01:20.040
Hopefully you have some fun with that.

01:20.080 --> 01:25.240
Typically people would create these masks programmatically with something like segment anything, which

01:25.240 --> 01:26.680
we'll show you in a later module.
