CosmicLaca / ComfyUI_Primere_Nodes

ComfyUI node pack
GNU General Public License v3.0
107 stars 13 forks source link

Suggestion for improvements to segs and any detailer nodes #22

Closed EricRollei closed 7 months ago

EricRollei commented 7 months ago

Thank you for your custom nodes. I'm experimenting with them now. I particularly like the feature you introduced that only pastes the detailed item if it's improved. So far just doing faces. The nodes will pass a face that is substantially different in color after detail, and in pasting, I can't figure out how to past without the crop lines showing. I've tried different bounding box sizes and different parameters for feather, however I can't seem to change the segmentation to the face only rather than a box. Colormatch node might help with the color, and allowing the segment to be only the face instead of a rectangle may help improve the match.

image

CosmicLaca commented 7 months ago

@EricRollei Thanks for your comment! For the color detection and matching I already have solution. Same problem with eyes, if the original is brown, de detailed maybe blue (same problem in mouth and faces). The solution is exist, and I have plan to push the code soon, but I need more time to done. Is your image contains the workflow for loading? If yes I will try out with another settings.

What can I suggest you before:

Within the code a function modifying the detailer's settings by the size of detailed segments. For example if the segment is too small or too large, (eye or mouth) then resizing to larger and multiply/divide the steps by math. I need more time to optimize this idea, but I got better result after these optimizations, maybe 46 steps is too much for the multiplier (if the face i small).

EricRollei commented 7 months ago

Thanks for the quick reply and suggestions. I will try them. I did have the steps and CFG set higher because I'm using a model path that has dynamic thresholding in it. I am trying to get very sharp details in the overall image. Previously I have been using Dr. Data's face detailer from impact pack. I found that several cycles were better, but in those nodes, I use the hook where the denoise is decreased each cycle.

The reason why I changed the crop factor was to include more of the original image so that it might match better. The issue is mostly a big change where the neck of the pasted refined image lays over the original.

About the prompt. I can convert the widget to an input and pipe the original prompt to your node, however it won't only describe the face. Do you think that is better?

CosmicLaca commented 7 months ago

@EricRollei You can mix the original prompt to the refiner's prompt using the input positive_original and negative_original but the strength of original prompts must be lower, because if high or just use the original image prompt the refiner will re-create the full original prompt within the face. So the refiner's positive prompt is very important, enter the details of face only with art style, color, and mood. If the refiner's prompt is good, I think the mix of original not too important.