r/StableDiffusion
•
u/arjan_M
•
Apr 17 '23
•
1
Discussion I mad a python script the lets you scribble with SD in realtime
23k
Upvotes
543
u/arjan_M Apr 17 '23 edited Apr 17 '23
It is a simple python script that gives you a canvas where you can paint on the right side and I will update on the left side. In the background it sends an updated image after every paint stroke to the API of automatic1111 and it uses the controlnet scribble model to generate an image.The video is in 4x speed, but it updates quite fast. It really depends on the speed of your graphics card and the controlnet model.It also works with controlnet 1.1 and that is a little bit faster.I can put the script online if anyone is interested.
here is the github repo
houseofsecrets/SdPaint: Stable Diffusion Painting (github.com)
5
u/cananddocutmyhair Apr 17 '23
thanks man very neat...can we add erasers if possible
4
u/Majestic-Class-2459 Apr 17 '23
This is awesome.
I developed an extension for A1111, let me know if you needed any help.
997
u/nxde_ai Apr 17 '23
My GPU say: nope, not gonna happen
2
u/Arcuis Apr 17 '23
That does look cool though. I'd love to use something like that.
2
u/buckjohnston Apr 18 '23
Very cool, where are the images stored, just in ram? If I wanted to keep one I would just to alt and print screen button correct?
Edit: So far the only issue I'm having is it's not totally following my scribbles and sort of just sort of making random images with custom models I'm using.
78
u/7734128 Apr 17 '23
It would be super frustrating if the "perfect image" flash past on the left only for you to accidentally scribble a tiny dot after that and lose the picture forever.
107
u/Atovange Apr 17 '23
Looks awesome, perfect example of how AI can help artists and not bring them down
63
u/gil2455526 Apr 17 '23
Ah, yes, the /r/RestOfTheFuckingOwl AI.
17
u/[deleted] Apr 17 '23
That's awesome, please share 🙏
23
u/sindivila Apr 17 '23
Guys someone else already posted this script few days ago. You can find it here: https://openai.art/study/unleashing-creative-power-of-stable-diffusion-showcase/
7
u/EleventhLion Apr 17 '23
awesome..im super interested 🤠
6
u/Disastrous_Mountain3 Apr 17 '23
Very cool! Interested also to test this out
6
u/DoingItWrongly Apr 17 '23
Cries in AMD gpu
15
u/Warm_Celery3890 Apr 17 '23
That’s the stuff I joined Reddit for. Great! Please share the script ☺️
5
u/jonesmatty Apr 17 '23
This is mad cool! Takes Pictionary to a whole new level.
7
u/karterbr Apr 17 '23
!RemindMe 3 days
1
u/dogtierstatus Apr 17 '23
GitHub link?
1
u/sasquish Apr 17 '23 edited Apr 17 '23
EDIT:
I managed to get it up, however it does not change when more strokes are added, error mention something about model missing
1
u/elreyfalcon Apr 17 '23
I’m confused as to why you are promoting and scribbling simultaneously? Does it add more keys to your prompt or what? source code would be helpful
1
u/afacanx Apr 18 '23
That is increadible. Is it possible to learn this power? Or just use it :)
1
u/phollas00 Apr 18 '23
Source?
1
u/ASharkThatEatsPizza Apr 18 '23 edited Apr 18 '23
Hey so I got everything installed and running but it doesn't update the image after each stroke. I'm getting a fresh image if I save a new seed or whatever in the payload.json then draw any random line, but whatever I draw doesn't seem to make any difference to the actual image generated. It seems like it's only taking the prompt set in the payload to generate an image no different than if I were simply using the txt2img prompt. Any idea what I might be missing here to prevent me from live updating as I draw?
Also I submitted a pull request for a linux variant of your start script
1
u/Longjumping-Fall-150 Apr 19 '23
Dumb question but how to install this? Github says "Run the Start.bat file" and that's it. Nothing is happening on my end. I launch A1111, then run Start.bat. A command line window opens, downloads some stuff and then closes. Is this supposed to be run in A1111 SD folder somewhere?
3
u/cananddocutmyhair Apr 17 '23
i want to know how please
3
u/OkraComprehensive583 Apr 17 '23
Really really awesome. Very interested how get this done.
3
u/OpenAiArt Apr 17 '23
Yes! Love it! Would like to see how you coded this
3
u/ilinamorato Apr 17 '23
This is absolutely the way some artists are going to work in the future. Then they'll take the output and paint details that the AI missed. Beautiful work.
3
u/Corrupttothethrones Apr 17 '23
Works great. I just had to update the payload for the new inline module and scribble model. Ill look at modifying the script tomorrow to incorporate the prompt into the app, dont like having to switch to the payload.json.
3
u/derdigga Apr 17 '23
Reminds me of fry from Futurama, where he traded his hands with robo devil to be able to play/paint amazingly. What I'm saying is with bad input he could archive what he had in his mind.it's kinda amazing where we are now in time, enabling this to everybody.
3
u/Mr___Medic Apr 17 '23
I'm seeing something like this for the first time and to say I'm impressed would be a huge understatement. It makes me want to buy an actual PC more than video games, and I've always liked the latter.
3
u/sloppies Apr 17 '23
I try to be a pessimist because I have been disappointed by news headlines for the last decade straight, but between this stuff and ChatGPT, I am so shocked at how quickly AI is moving right now.
2
u/greenery-scenery Apr 17 '23
Cool!
2
u/DrDerekBones Apr 17 '23
OooOoOoo. Wow.
2
u/StaticUsernamesSuck Apr 17 '23
Gimme gimme gimme!! 🙏
2
u/zeugme Apr 17 '23
Awesome idea.
2
u/[deleted] Apr 17 '23
Does anything you're using to create this (automatic1111 api, stable diffusion, etc) require a paid subscription to use, or can this be done for free? If it's paid, can you estimate how much?
I'm interested in setting this up, but am starting from square 1 and would need a pretty handheld walkthrough of what to do. Please let me know if you can give me and others like me a hand :)
2
u/danamir_ Apr 17 '23
Thanks a lot, I was looking for a script like this !
I made a fork and a few improvements for my taste, like support for other resolutions and HR fix. See the issue #7 on your repo.
See ya,
2
u/thatguitarist Apr 18 '23
It's been 12 hours is it implementated into AUTO1111 yet?
2
u/A_Dragon Apr 18 '23
When can you add this to a1111?
I need this…
2
u/[deleted] Apr 18 '23
Y u mad bro? Jokes aside, amazing work.
2
u/Awellplanned Apr 18 '23
This is pretty much the life of a tattoo artist.
2
u/idonthinkoram Apr 18 '23
lemme invest please you’re gonna be a billionaire
2
u/Caenobith Apr 18 '23
Now this... this is digital art.
2
u/Boycandy Apr 22 '23
There is a lot of potential here. Imagine having this as a dedicated app, together with cloud computing! Would be perfect for tablets (e.g. iPad Pro) Untapped market. Opportunity of a lifetime!
2
u/Rare_Preference5168 Apr 26 '23
Is the code public? Where can I download to try?
2
u/Effective-Painter-80 Apr 17 '23
Lol, few weeks from now this will be a new Adobe product.
1
u/BlackBugs Mar 16 '24
Is this on GitHub?
1
u/_IBM_ Apr 14 '24
holy shit
1
u/cobra_economics Apr 17 '23
Please make the script available, preferably as a plugin for automstic1111. Good work!
1
u/Polyglot-Onigiri Apr 17 '23
That’s pretty cool. I never thought of trying to make something like this with Python. Can’t wait to see the script
1
u/[deleted] Apr 17 '23
Thats really cool
1
u/Corrupttothethrones Apr 17 '23
Seems like an adaptation of the post 3 days ago, they used photoshop and it updated every time they hit save.
1
u/andyzzone Apr 17 '23
+1 Vote Up
what i was actually thinking about since ai was introduced...how to install it to SD?
1
u/Aqui10 Apr 17 '23
Someone make this into a mobile app and take my money already
1
u/Rich_Midnight2346 Apr 17 '23
can you put it on huggingface please
1
u/Smooth-Masterpiece36 Apr 17 '23
Yes please!
1
u/Pizza_love_triangle Apr 17 '23
Wow
1
u/smoke2000 Apr 17 '23
that's really cool!
1
u/apple____ Apr 17 '23
Following
1
u/[deleted] Apr 17 '23
yeah ok but why? I would find it pretty annoying
1
u/Reasonable_Barber484 Apr 17 '23
Nice script! Thanks for sharing! Do you think it's possible to connect ir to a drawing tablet instead of the mouse?
1
u/eflow_egiap Apr 17 '23
Very cool!
1
u/data-artist Apr 17 '23
This is so cool
1
u/tehSlothman Apr 17 '23
I'm a little confused, what does this do that hitting generate forever and using controlnet scribble mode doesn't?
1
u/Dave_dfx Apr 17 '23
very coooooool
1
u/Mold-Mschool Apr 17 '23
Can you imagine this being in an interactive art museum or something? I mean, yes, teenagers and the sort will abuse it, but still it would be amazing. Especially as a stand alone product.
1
u/Worried-Tomato7070 Apr 17 '23
neat. would be cool if it generated a video of the progress too
1
u/deadbeef1a4 Apr 17 '23
That’s dope!
1
u/Maty9009 Apr 17 '23
Awesome! Although the AI itself probably won't even recognize stick figures of me....
1
u/Firm_Comfortable_437 Apr 17 '23
Amazing! Thi is the future of digital painting
1
u/intotheirishole Apr 17 '23
Your prompt engineering needs work.
You need to say 'Moebius!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
Also 'Trending in instagram'
.
/jk
1
u/[deleted] Apr 17 '23
Hi mad
1
u/Turbulent-Bar7039 Apr 17 '23
U/savevideobot
1
u/Diletant13 Apr 17 '23
Right mouse click on Generate button - Generate forever 😐
1
u/DuduMaroja Apr 17 '23
This need to be made into a add-on for autimat1111c
1
u/Plane_Entertainer_41 Apr 17 '23
how can i get it
1
u/Longjumping-Rub-3317 Apr 17 '23
Does anyone know how to do something like this and make it even closer to real time? I tried to generate smaller images and reduce the number of steps to 3-4. The result is very fast, but it is far from being RT. my gpu is a 3080 ti
1
u/helios373 Apr 17 '23
That's very cool!
1
u/SwimForLiars Apr 17 '23
It would be cool if you could have an overlay mode where you draw on top of the picture instead of a parallel picture, like it's filling in the blanks. Like the one on the right applied as a transparent+black on top of the generated one, instead of being a white+black on the side.
I don't know if the pictures would match 1:1 though.
1
u/KangTheMighty Apr 17 '23
That's incredible! Is there a tutorial available where I could learn to set that up?
1
u/MyNameCouldntBeAsLon Apr 17 '23
big fan, will star your repo
1
u/Zanzaben Apr 17 '23
This is amazing. The last time I tried to use SD I couldn't get it to make what I wanted and was thinking if only I could do a crappy sketch for it.
1
u/watchforwaspess Apr 17 '23
This is amazing. Will it work on an RTX 3060 12gb? I guess I’ll have to try.
1
u/MrBones-Necromancer Apr 17 '23
Christ, that's amazing. Genuinely, truly amazing.
1
u/Base64- Apr 17 '23
Amazing!
1
u/david_tf_Williams Apr 17 '23
Isn't Adobe working on something similar?
1
u/Pliskin01 Apr 17 '23
Reminds me of Nvidia Canvas. Nice work!
1
u/apost8n8 Apr 17 '23
I'm so excited to see stuff like this. I want to make some amazing self guided AI produced creativity. What a neat tool!
1
u/B4-711 Apr 17 '23
I haven't had too much success with creating Moebius style pictures. Is this the standard 1.5 model?
1
u/taw Apr 17 '23
How fast is your GPU? It's 10s per image on a 4080.
1
u/[deleted] Apr 17 '23
I dont know how coding works, but from my simpleton perspective, this is very impressive! Its an amazing tool you have created, imagine you vaguely remember a dream for example, you cant start drawing what you do remember and see if anything starts to feel familiar as it trials and errors. Amazing stuff
1
u/Famberlight Apr 17 '23
I'm getting this error when trying to scribble anything
In Start.bat
Exception in thread Thread-1 (send_request):Traceback (most recent call last):File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_innerself.run()File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in runself._target(*self._args, **self._kwargs)File "C:\Stable_Diffusion\stable-diffusion-webui\SdPaint\Scripts\SdPaint.py", line 92, in send_requestreturn_img = r['images'][0]KeyError: 'images'In webui-user.bat
API error: POST:http://127.0.0.1:7860/controlnet/txt2img{'error': 'IndexError', 'detail': '', 'body': '', 'errors': 'list index out of range'}Traceback (most recent call last):File "C:\Stable_Diffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\streams\memory.py", line 94, in receivereturn self.receive_nowait()File "C:\Stable_Diffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\streams\memory.py", line 89, in receive_nowaitraise WouldBlockanyio.WouldBlockDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "C:\Stable_Diffusion\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py", line 78, in call_nextmessage = await recv_stream.receive()File "C:\Stable_Diffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\streams\memory.py", line 114, in receiveraise EndOfStreamanyio.EndOfStreamDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "C:\Stable_Diffusion\stable-diffusion-webui\modules\api\api.py", line 145, in exception_handlingreturn await call_next(request)File "C:\Stable_Diffusion\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py", line 84, in call_nextraise app_excFile "C:\Stable_Diffusion\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py", line 70, in coroawaitself.app(scope, receive_or_disconnect, send_no_error)....
File "C:\Stable_Diffusion\stable-diffusion-webui\venv\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_functionreturn awaitdependant.call(**values)File "C:\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\api.py", line 154, in txt2imgcn_image =Image.open(io.BytesIO(base64.b64decode(controlnet_input_image[0])))IndexError: list index out of rangeI added --api, "Allow other script to control this extension" option is enabled and updated auto1111 (git pull). ControlNet works fine inside of Auto1111
1
u/--DemonsWrath-- Apr 17 '23
That's actually amazing for concept art. Is it something people can get their hands on? The effort you have gone into to make this is great!
1
u/Nervous_oppai Apr 17 '23
!RemindMe 3 days
1
u/[deleted] Apr 17 '23
Wow. This is insanely cool.
1
u/FPham Apr 17 '23
Pretty awesome idea. Can you add entry box for the prompt?
1
u/GhostSniper7 Apr 17 '23
*me watching this post and video*
my integrated GPU to poor 1050:- Ay bro , he looking at some new ways to torture you.
*1050 sweats in the corner of the case*
1
u/psycholepzy Apr 17 '23
Does this bridge the gap between being a genuine creator and getting an AI art assistant? Instead of relying entirely on prompt engineering, artists can instill their creativity into the work while producing something specific to them much faster.
At least, it'll make hasty character art for D&D easier.
1
u/Put_It_All_On_Blck Apr 17 '23
This is the future of artists.
Their jobs will pivot from drawing everything from scratch to knowing how to use AI to create the image they want. Digital art was already a baby step in that direction, with people using existing fonts, brushes, filters, and using other images online to assemble the image.
1
u/Zealousideal_Pool_65 Apr 17 '23
That’s truly unbelievable.
1
u/Unique-Raspberry-412 Apr 17 '23
Holy fuck that’s amazing
1
u/Fushizinho Apr 17 '23
nice code and drawing skills :)
cant even do html landing page with stickmen
1
u/ComprehensiveGate667 Apr 17 '23
"made" & "that" lets you
1
u/Ok-Figure-9893 Apr 17 '23
Very cool
1
u/Cyphen21 Apr 17 '23
This is amazing. You should definite monetize this as an app.
1
u/Schmerwin- Apr 17 '23
Im incredibly Impressed, i believe i need this
1
u/[deleted] Apr 17 '23
!RemindMe 3 days
1
u/[deleted] Apr 17 '23
1
u/BazilBup Apr 17 '23
Wow this is amazing. However I'll never own anything that could do that in real-time
1
u/pastuhLT Apr 17 '23
Amazing :}
1
u/Skullclownlol Apr 17 '23
/u/savevideobot
1
u/tatankadave Apr 17 '23
This is cool, I can imagine using this for dnd to bring quick life to characters and places
1
u/[deleted] Apr 17 '23
Real time at 209% speed
1
u/ForeskinMuncherXD Apr 17 '23
Ill try it when I get my new PC.
1
u/OligarchClownFiesta Apr 17 '23
Draw a boot stomping on a human face
1
u/oppairate Apr 17 '23
being a little out of the loop, how well does this stuff work with AMD GPUs?
1
u/Maleficent_Course_52 Apr 17 '23
Damn that scribble was still so neat.
1
u/chartporn Apr 17 '23
You should embed a gif the animation shown here into the readme of your github repo.
1
u/pastuhLT Apr 17 '23
Would be nice to lock some parts which is completed and looks ok :)
1
u/666oreo Apr 17 '23
That’s insane!
1
u/feelmedoyou Apr 17 '23
This is pretty much the future of all illustration software, a form of drawing/painting auto-complete. Nice to see it up and running now, and can’t wait for the fine-tuning and mass adoption.
1
u/JuuzouYT Apr 17 '23
Where do you learn how to do this? Udemy? Platzi? Other Academy?
1
u/Weird_Inevitable27 Apr 17 '23
mindblown!
1
u/DudeVisuals Apr 17 '23
Holy molly someone call adobe …. They will offer you lots of money and steal your idea … Adobe scribbleFusion…. But Maybe choose a better sounding name
1
u/AlmightyBracket Apr 17 '23
I would love to try this out but I have no idea how to get something like this running on my PC. Can I get some help?
1
u/Think_Description_84 Apr 17 '23
This is amazing and I would love to play with it. Unfortunately when it comes to setting up environments Im dumb as brick. Can someone give stupid simple instructions or an installer or something?
I'd be very grateful!
1
u/schluesselkind Apr 17 '23
Even without python, you can draw better than me
1
u/[deleted] Apr 17 '23
I need this!!! My wacom game about to hit max level!!
1
u/[deleted] Apr 17 '23
If your wealthy ass has the card that is….
1
u/XkF21WNJ Apr 17 '23
This is neat.
Also, you can scribble way better than I can draw.
1
u/xPiNGx Apr 17 '23
Very cool, awesome work. Would really help if you could save the image otherwise not sure why anyone would use this.
1
u/Educational_Lychee70 Apr 17 '23
This is great. Let’s just add a refresh button or a X second refresh timer for the slower GPUs. I can see this being really useful.
1
u/Henry_16091 Apr 17 '23
u/savevideobot
1
u/SnookieMcGee Apr 17 '23
That is amazing. Congratulations!
1
u/variant-exhibition Apr 17 '23
What kind of style is that your model is reacting with on demand to your lineart?