10 minutes

Fixing photos with Stable Diffusion

In this video, I demonstrate how I restored some faded memories from my trip to China, using Stable Diffusion. I'll show you how I brought life back into these photos with a creative twist.
00:00

Yes, all right. Yeah, so my name is Jasper. Working as a data scientist and playing a lot with AI. And two weeks ago I was on a trip to China. I took a lot of very bad pictures there, which is a shame, right? I can't use the whole main Instagram or anything. So I had the idea to use a stable diffusion to try to improve it.

00:31

And it's really like a short demo that I started last weekend. So we're going to see what's possible. So this is like the Olympic Tower from my iPhone engaging. And on the right is some sort of stable diffusion improves version as if it would have been shot by a 35 millimeter analog camera. A little bit sharper, other colors. And it's actually, I found it quite difficult to change these colors and the styles.

01:05

So I don't know if you've seen the Magnific Obscator. This was actually started in December only and acquired in the last month at Freepig. Really cool stuff they do. So this works by having my below resolution image, obscating it. And you can sort of tune under the creativity, consistency, and the aesthetics, right? And for my holiday pictures, I'm really interested in a very good consistency.

01:38

So I don't want any fantasy things like I want to actually have pictures of where I've been, right? But they should just be better. So which is really difficult, I found. So there are these new control net files, which conceptually work by just tiling your image in very small tiles. Having that as a constraint in your AI workflow and have an image generate an image which has similar tiles.

02:12

Then I'm also using basically all the control nets I can find, which you see relevant. So I want my nice looking image to have the same Kenny edges. I want my same deck map. And then you can just add them all to better, right? So I've been learning this coffee UI, image generation by a van. I don't know if you've been using it or trying it, it's really cool.

02:41

And you said everything in the fuses, but this is so much faster for quick prototyping and everything. Just see. I think it's live on my PC, which reconnects. Well, it looks like this. You have all these nodes, loading models, doing all these steps. And then in the end, you've got your picture, right? So I just want to show some examples.

03:15

So I'm left my original iPhone picture. And then this is how far I've got now. So I can do some images that have wider, better colors, more sunny, a bit nicer looking, but it does go a bit too creative, like on the right. So you get these three, which isn't there, right? It's bad. So I need a bit more control for sure. And especially in this scene, so this was in Homecoin, which does, I think, it's a better picture.

03:49

I mean, it's more dramatic for sure. But there's a different building here, right? So it's, yeah, that's difficult. I think the Chinese characters are also wrong, but then I won't be able to see that. It's not too very like this. But what's really cool actually is, when you've now made this confuite workflow , there are now very cool ways to quickly make an API out of it.

04:20

It's like maybe half an hour work. So I did it with a different model than this. There's a few GitHub repos where you just replace a JSON, which has the workflows. And you can push it to replicate and have a live API ready. So for instance, well, this is the GitHub repo, replace one JSON in the predict or pi. And then you've got your API, which you can use in Python.

04:54

You know, you can set this up. Choose the GPUs you want. Choose to have it active or not. Pay it for seconds. So that's really, if any of you are working with confuites, really something I would investigate for sure. All right, so I think my five minutes are up. And yeah, thanks for the opportunity.

05:20

[APPLAUSE] Could you scroll back to the last slide, please? No. No. And in with UI in a studio. With two photos in a studio with UI. It was from a browser. Ah, the browser. Yeah. Yeah, yeah, yeah, this one.

05:47

So this was not like another workflow. So how does it deal with people? Yeah, faces are definitely changing. I've seen. So I try to get in control with both as well. Then at least you get all the people there, right? But faces, I don't know why, but faces really change more than other things. I feel with these style approaches.

06:16

Right. And what model are we using? Because there's many stable deficient questions. This is, as the Excel would, that there are real deficient for. And a few Laura's as well. Like a better detail. So I'm not really interested in having a fast API or anything here, right? Because it should just run over my pictures and be fine.

06:42

So I can definitely add on Laura's and big models. And have many control nets. And I might be with this. Or the part was they created for it, added the tree, and all that. But you can use negative prompt to, like, I mean, if you do a few iterations, reduce. So they create a few, if you can still get the white votes, see your colors. Yeah, sure.

07:10

Yeah, I think it's definitely a matter of just trying, right? If you don't care that it's right every time. Then it's fine. And on the basis, I think, it still looks like a, you know, object rigging and face recognition and replace it with some source for us, right? It's more work. Yeah.

07:32

Well, that's, so I'm also interested. It's real like color replacement. So that's sort of the, I think, pasting things back would be more difficult. Or basically, if you really do like, like, for instance, the 35 millimeter, so this changes a lot of color, right? And pasting back the faces, yeah, that, I think. Yeah. Maybe it's just these workflows are not, are not, like, for all, you know, objectures.

08:10

Yeah. What are you doing in each other's knowledge of their graph? So, like, I can definitely show them. Like a product or, let's see. Yeah, so it's not actually most of them done too much. So it does, it does the stable fusion image here. It does some prompting here. So basically choosing some custom prompts and some more models.

08:52

Let's see. Go text. And so, so you kind of tweak it. I have this preview of types of, so, so, you know, so graph. And then you kind of preview and click it like this. And then you have like inputs and outputs. So it could be, for instance, this one, let's see. Yeah, it doesn't show it all very well because I'm disconnected to my PC here.

09:21

It could be like images and inputs. And then the output is this step now. And that's going to be able to be the next one. And it happens with the text. It happens with models. As long as, as what you need as a note, or you can even use some custom byte in here, you can really quickly build your work flow here.

09:47

All right, thank you. [APPLAUSE] OK, so, 20 pages. [LAUGHTER] [BLANK_AUDIO]