Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur function #59

Open
K3nt3L opened this issue Aug 23, 2024 · 4 comments
Open

Blur function #59

K3nt3L opened this issue Aug 23, 2024 · 4 comments

Comments

@K3nt3L
Copy link

K3nt3L commented Aug 23, 2024

I don't see how to use ControlNet (Blur) with ComfyUI. Would it be possible to have an example workflow? Thanks in advance.

@bonlime
Copy link

bonlime commented Aug 28, 2024

You can see how to apply blur to your image here:

https://github.com/xinsir6/ControlNetPlus/blob/main/promax/controlnet_union_test_tile_deblur.py

@TheOnlyHolyMoly
Copy link

TheOnlyHolyMoly commented Sep 1, 2024

my two cents... it is an incredible pain getting this to run in a windows machine. Here are my learnings
-clone the repo
-create subfolder in .\promax and name it controlnet-union-sdxl-1.0-promax (copy the config promax json here and rename it to config.json)
-open cmd prompt as administrator
-make and activate venv
-install requirements (pip install -r requirements.txt.) if you should happen to have a windows machine like me this is where the fun starts... some packages will have difficulties to install (deepspeed is difficult but solvable with some effort, triton will not install on windows machines since they only want to support linux, the script works without triton so, so just delete that from the requirements.txt if you should run into errors.
once you have installed all requirements more or less go to the script, and find the "path" sections, you will need to customize the script
open in editor an find the following sections (with my settings as example input)

prompt = "woman eating cheese"
negative_prompt = 'longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality'
controlnet_img = cv2.imread(r"F:\promax\Input.jpg")
controlnet_img.save("controlnet_deblur.webp")
images[0].save(r"F:\promax\output.jpg")

save, run script from commandline. In spite of having performed all install-requirements it gave me some errors where some pip packages were implicitly expected but missing in my venv yet. if you follow the line remarks in the traceback it'll tell you quickly what packages you need to ammend (look at the top of the traceback where it breaks, usually it'll tell you that a function is missing and then you can look up in the script in the line that is referred to from which package that function comes then just pip install that package and try again) and then it'll run beautifully.

Oh quick catch, it will download the promax model into the promax folder but you will have to rename it accordingly (scratching out the promax part)

I still have not yet figured out how the controlonet works on its input. I had it run on blurry images and it did very little unblurring and I had it run on strongly pixelized faces and it create a plausible face (not the one of my reference test, but yet impressive)

It is absolutely worth the pain!! great cudos to @xinsir6 for making this!! amazing!

@K3nt3L
Copy link
Author

K3nt3L commented Sep 2, 2024

It's very kind of you to respond. Unfortunately, what I want is to be able to use it with Comfy. Unfortunately, the parameter (SetUnionType) does not exist for the Blur function. Moreover, as you say, we don't really know how to handle the input image.
If we look in the script, there is no number for the Blur function. It's the same in ComfyUI, but there is an auto function. I use CN without any problem, except for "Blur" whose usage remains mysterious.
Do we use a blurred image to make it sharp ?

@TheOnlyHolyMoly
Copy link

I pushed in a blurry image and it returned a sharper version to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants