Settings

Theme

Show HN: A little side project, a watercolor art generator

brushify.art

224 points by nfriend 3 years ago · 82 comments (78 loaded) · 1 min read

Reader

Hi HN - this is a little side project I threw together. Some implementation details: image processing is all done with headless GIMP (running inside a Docker container) through its built-in Python API. It's _very_ slow (about 50 seconds/image), and currently it processes exactly one image at a time. The website is built with NextJS; payments are processed by Stripe.

I've had the best results with pictures of houses, although certain photos of people or nature can look neat, too. (For example: https://brushify.art/s/ruYmQWk, original photo from https://en.wikipedia.org/wiki/Pillars_of_Creation.) The effect obscures the edges of the photo, so images with plenty of margin around the subject work best.

Something I'd like to play around with is swapping the GIMP script for an AI-based process (maybe using something like Stable Diffusion?), with the goal of generating images that look more handmade (something like these: https://www.etsy.com/ca/search?q=watercolor+house). I have exactly zero AI experience though, so there would be a bit of a learning curve.

Would love any thoughts or critiques!

----

edit: remove unrelated details

rikroots 3 years ago

Creating a watercolor filter which can be applied to an image dragged into a website <canvas> element is on my list of Fun Things To Do Over The Holidays - but having previously looked at the the mechanics that need to feed into the filter ... well it looks like I'd be jumping down a rabbit hole of complex maths and generative art approaches[1][2]. It's a complex problem space and I'm not sure I have the brain power and tenacity to do a good job of it.

[1] - Tyler Hobbs (2017) - a guide to simulating watercolor paint with generative art - https://tylerxhobbs.com/essays/2017/a-generative-approach-to...

[2] - Curtis|Anderson|Seims|Fleischery|Salesin (undated) - Computer-Generated Watercolor - https://grail.cs.washington.edu/projects/watercolor/paper_sm...

kuu 3 years ago

My recommendation: Add examples on the main page, so the new users don't need to overload your site.

Otherwise the process is the following:

I enter the page -> Upload image -> See 4h of queue for getting my result -> I close the tab, leaving there a pending task.

synapticpaint 3 years ago

It sounds like your app turns photos into a watercolor style image? You can definitely do this faster with Stable Diffusion (~6s per image before optimization).

Here's how I would approach it: train a dreambooth model on watercolor style images, then run image-to-image using that model.

For examples of what dreambooth models can do see: https://synapticpaint.com/dreambooth/info/ (sample images here generated using a "modern disney" style model).

If you need help getting this set up feel free to email me! This stuff is probably not harder than getting gimp to run in a container.

  • wongarsu 3 years ago

    Stable Diffusion on beefy hardware is faster than OPs process in OPs docker container, but I don't think we can judge from this that OP uses a slower process. For all we know this is running on the equivalent of a $10 Digital Ocean droplet.

    • nfriendOP 3 years ago

      Currently running on a t3.medium AWS EC2 instance! (My max budget is currently $50/month since I get that much in AWS credits each month for building an Alexa skill a few years back.)

    • synapticpaint 3 years ago

      That's true. I just wanted to provide some context for OP and others reading since they mentioned an interest in AI generation, and I think not everyone knows that dreambooth + stable diffusion has this kind of capability.

  • nfriendOP 3 years ago

    Very interesting, I will look into this! Thanks!

  • rlv-dan 3 years ago

    This comment make me sad. Replacing human creativity with "ai" is like we've reached the peak so no need to put any effort into life anymore..

    • synapticpaint 3 years ago

      I don't think that AI image generation in its current form replaces human creativity. You still need a human to guide the process, compose the image, judge the output, etc. What's being automated is the manual, traditional process of painting and drawing.

      I see this technology as more analogous to hand writing books -> printing. I predict that more people, not less, will be involved in creative industries related to visual arts (design, film, illustration, animation, etc.) as a result of this technology becoming more accessible.

      • JoeAltmaier 3 years ago

        That's skipping over all the skill and training needed to draw, well, what most of us are unable to draw.

        We can all write words with a pencil. That's not the same as drawing an original character or scene with skill.

        • UncleEntity 3 years ago

          The photography industry would like to have a word with you.

          Or all the (now dead) people who were saying the same things about photography.

          • JoeAltmaier 3 years ago

            Yeah and photographing art and claiming it is yours, is surely copyright infringement.

            These disingenuous arguments are not taking the conversation forward.

            • jasonjmcghee 3 years ago

              I don’t think that was the point parent comment was making. I took it as all the skills you used to need for photography, like developing photos. Now you can point and click with a phone.

              But everything else that goes into a good photograph, like what to use as your subject, the composition, post processing, etc is still important.

              • JoeAltmaier 3 years ago

                Sorry, I retract.

                Now I'm just confused. How is photography not just what I indicated - something involving skill and art that it's illegal to copy and claim it's yours?

                • jasonjmcghee 3 years ago

                  Original comparison was discussing how writing words with a pencil that exist already and aren't your original creation isn't drawn art, and a response was given that seemed to imply photographs were pictures capturing something that they didn't create, implicitly prompting the suggestion that just because you didn't create the subject of the art doesn't mean it's not art.

                  If you take a picture of a stone fountain and claim the photograph is art, is it copyright infringement because you didn't sculpt the fountain?

    • JoeAltmaier 3 years ago

      Yes, this is different from much of art history. Instead of coming up with original characters or styles or backgrounds and palettes, we just ask a computer to do it all and usually by copying somebody that can do those things.

      Art will take a hit to be sure, and the brunt of it will be taken by artists with actual skills.

    • conductr 3 years ago

      It actually kind of excites me to see what kind of human creativity will blossom in the wake of AI. What art will humans eventually create that is so unique that it's obviously not AI? That's the exciting part, but it could be a difficult/long journey.

    • jamesgreenleaf 3 years ago

      Human creativity isn't being replaced; new layers of it are being added.

    • adammarples 3 years ago

      running a GIMP script is hardly the opposite

nfriendOP 3 years ago

Sorry all for the long wait times! Was not expecting much interest. At the very least, I need to look into removing photos from the queue when people exit the page.

  • selcuka 3 years ago

    I wouldn't even let people add new images to the queue if the wait period is over, say, 10 minutes.

  • wishinghand 3 years ago

    How is the image processing being done? In broad strokes, what're you doing with the Python API?

    • dylan604 3 years ago

      Do water color artists use broad strokes?

      • gilleain 3 years ago

        Ho ho. As far as I know, you can make a wash with a broad brush.

        Watercolour is a nice way to paint blurry things like oceans and clouds, which involves broad strokes.

  • nfriendOP 3 years ago

    Moving it to a larger AWS instance - will be down for a few minutes!

    • nfriendOP 3 years ago

      Done - upgraded to a t3.xlarge. Now it can process 4 images in parallel. Still not enough to keep up with HN demand, but it should chew through the queue a _bit_ faster.

  • jansan 3 years ago

    It says I should keep that tab open for the next 17 hours. What happens if I still close it?

    Congrats for the unexpected success :)

    • nfriendOP 3 years ago

      Unfortunately nothing at the moment! Currently working on removing images from the queue if the user has left the page (which I'm guessing is the case for about 99% of the current queue).

      • nfriendOP 3 years ago

        Fixed! Now abandoning the tab will remove the image from the queue.

tfsh 3 years ago

The example looks cool, but I'm currently in an 11 hour queue :(

Any chance of porting this to the web using WASM? I've used ImageMagick in the browser before, I've never used Gimp, but if there's enough overlap you could use the former. That's of course assuming two things:

1) you have the time

2) you're happy to port the closed source, source code to the client

Both of which are perfectly fine to answer with a "no" :)

Also, I think it would be prudent to terminate the request if the client instance is destroyed. Right now I assume there's a bunch of requests being processed for users who have closed the tab.

wingworks 3 years ago

The results are pretty cool, though it's a shame it cropped the edges. https://brushify.art/result/aa4e68ae-d9de-4673-830e-f88032ec...

chrischen 3 years ago

Our watercolor filter produces pretty good results (the Flower Market filter which also happens to be the example shown): https://www.instapainting.com/assets

You can implement with something like this and simply train it against a watercolor image: https://github.com/yusuketomoto/chainer-fast-neuralstyle

Haven’t tried it with stable diffusion but you’d probably have more control and better results with a CNN like the one I linked.

andai 3 years ago

Here's a suggestion, port it to run in the browser. Free parallelism, because every user brings their own hardware :) So it scales infinitely, for free.

jasonjmcghee 3 years ago

Fortunately OP, experience with AI is generally unrelated to success with Stable Diffusion / DALLE.

What you want to gain is experience with prompt engineering for these tools.

Here's a good resource https://openart.ai/promptbook

bambax 3 years ago

> I'd like to play around with is swapping the GIMP script for an AI-based process

Dall-e offers an API with some limitations (max 4MB square PNG, content filtering): https://beta.openai.com/docs/guides/images/usage

Photopea.com has a watercolor filter, in JS, all client side. It's not very good ATM so there's certainly room for improvement. Doing it all client side would solve the queue problem.

gregoriol 3 years ago

If you can make it with GIMP, you could probably look into OpenGL shaders to do it directly yourself: the processing could be faster and would provide you with more flexibility and coding fun times. I don't know of server-side libraries for that, but on iOS we have MetalPetal which provides some filtering features like ones in Gimp/Photoshop.

Have fun!

ikkjo 3 years ago

Would you be willing to share some details on the GIMP implementation? Are you actually generating brush strokes and "paint" the image or is it more filter based? The background effect looks like brush strokes to me, but are the details done in the same way?

justchad 3 years ago

Nice, this is really cool! I don't see myself waiting for my photo to process as it's a ~4 hour wait but the example image is cool.

Like you said I bet using Stable Diffusion would speed this up dramatically but who knows if you'll get the same effect on your images.

_448 3 years ago

In addition to upload/drop image, you could also provide an option to enter an URL of online image. That will make it easy for users to try the project very quickly. Then provide an ephemeral preview URL to see the output.

yuvalkarmi 3 years ago

This is super cool! Didn't know you could run GIMP in headless mode.

seshagiric 3 years ago

I understand it's a side project but you do have a paid offering. So I am curious what are you doing with the images after they are processed?

asmosoinio 3 years ago

Site seems to be down - could you post the example output on some image sharing site?

Seeing example output would be interesting, even if service is hugged to death.

hollowdene 3 years ago

Can't see myself paying $5.99 for one of these, but it's nice. I appreciated the fun messages in the progress bar.

PS: Congrats on the little one. :D

iruoy 3 years ago

It's not exactly a hug of death, but a wait time of 90m is a bit long. I hope that people that leave the queue won't be processed.

_dan 3 years ago

Perhaps put the wait time on the homepage - If I'd known you were running at an 8 hour delay I wouldn't have added to it!

pknerd 3 years ago

The message on the page:

It's a busy day! There are currently 512 people in front of you. Please keep this tab open!

Estimated wait time: 7 hours, 7 minutes

  • thih9 3 years ago

    1h later it’s:

    > It's a busy day! There are currently 1073 people in front of you. Please keep this tab open!

    > Estimated wait time: 14 hours, 54 minutes

keizo 3 years ago

Super cool! Cnc painter next and make a business making custom cards for people!

stoobs 3 years ago

Estimated wait time: 6 hours, 33 minutes

Oops, sorry OP for all the traffic :D

the_arun 3 years ago

There should be a smart phone app for this already, right?

diego_moita 3 years ago

I just loved the messages while it is processing!

Kiro 3 years ago

Why NextJS for this?

Kaotique 3 years ago

Looks really nice!

notyourav 3 years ago

14h wait time

tristanbvk 3 years ago

Very vool

hackmiester 3 years ago

I'm going to go against the grain here. If this were my project I would try to spin up render machines dynamically in response to load. (Similarly to how gitlab CI runners can be spun up automatically, for instance.) There is no need to replace a working technology stack to make it faster. 1 minute is a reasonable wait time, and if your wait time goes over 5 minutes, then spin up some more workers.

Plus we have to be real and say, is the only reason the queue so long, because you let a bunch of nerds on HN add to the queue for free? I'm guessing the answer is, "probably." No need to engineer a fix for a problem that will typically not exist.

XCSme 3 years ago

I hope the result is worth the wait!

> There are currently 1069 people in front of you. Please keep this tab open!

> Estimated wait time: 14 hours, 51 minutes

  • calibas 3 years ago

    Currently:

    >There are currently 1200 people in front of you. Please keep this tab open!

    >Estimated wait time: 16 hours, 40 minutes

  • TT-392 3 years ago

    I have been stuck on 9 hours for a while now

moffkalast 3 years ago

> Estimated wait time: 2 hours, 35 minutes

Bruh moment.

I suppose it would make more sense to WASM the implementation and run it clientside?

ale42 3 years ago

Now: Estimated wait time: 9 hours, 49 minutes...

The hug is getting tighter ;-)

  • rikroots 3 years ago

    "It's a busy day! There are currently 1048 people in front of you. Please keep this tab open! Estimated wait time: 14 hours, 33 minutes"

xchip 3 years ago

Why do we need to know you did this while on paternity leave?

  • KraxKrokat 3 years ago

    Why do we need to know that this was made at all? Let the guy share a bit of context about his little side project (cool work btw!). Why are you so snarky today?

  • quest88 3 years ago

    What's the point of your comment? Why do you care? Why do we need to know about this project at all? Why is anything posted to hackernews at all? Why?

    Please discuss the project if it's interesting to you, otherwise move on. There is a human who posted the project. Maybe they were nervous to post because of the feedback they get. Maybe they wish it ran faster (as they noted on its slowness), and provided some context by stating they couldn't devote 100% focus to this project because they were caring for a new born baby.

  • pvg 3 years ago

    Be kind. Don't be snarky. Have curious conversation; don't cross-examine.

    https://news.ycombinator.com/newsguidelines.html

  • nfriendOP 3 years ago

    Thought it was some fun context, but I can see why it might come off as a strange detail to include. Edited to remove the distraction.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection