Relight People + Preserve Colors and Details

5.0

0 reviews
120
25.4K
9.8K
9
Description

Full tutorial here:  https://youtu.be/AKNzuHnhObk

Want to support me? You can buy me a coffee here:  https://ko-fi.com/risunobushi


This is a workflow that can be used as either a standalone or as a part of any other workflows.

It aims at color matching and preserving details when relighting people (and pictures in general, not just people) when relighting them with IC-Light.


It's basically doing the following:

- taking in the original image;

- relighting it by a hand drawn mask in "open in mask editor" (not automated way, default), or by a custom mask uploaded by the user (automated, not default);

- splitting both relit and original images in low frequency and high frequency layers;

- tone remapping the images to adjust for blown out highlights and shadows when color matching;

- applying 4 different color matching options (pick your favorite);

- applying an optional IPAdapter FaceID pass at the end.


There's plenty of notes to guide you through it, but if you have questions, leave a comment and I'll reply.

Cheers!

Andrea

Node Diagram
Discussion
M
Mitov10 months ago

EDIT: Please IGNORE THIS COMMENT, no issue in version 2


I am not sure if it is mentioned in the video tutorial, and if somebody else will get the errors i've got:

1 - For some reason I have got an error

"TypeError: 'NoneType' object is not subscriptable"

If you do not plan to use the "(Optional) ControlNet" group - connect the IC-Light positive conditional straight to the KSampler - that's helped me going forward passing the KSampler.

2 - In the "Original Image" group - entering an Image Resize value of 1024x855px - have got me the error:

Error occurred when executing FrequencyCombination: operands could not be broadcast together with shapes (855,3,1024) (848,3,1024)

Changing the value from 1024x855 to 1024x856 - does solve the problem.

Thank you Andrea Baioni for all the efford you put helping us, you really do!

(Edited)
a
andrea baioni10 months ago

The first issue is weird, bypassing the group entirely should basically do the same as going straight to the positive conditioning in the KSampler (it does for me).

The second issue is because I'm bad at coding and I didn't account for odd values in pixel count. Frequency separation is my first custom node and I'm most definitely not a coder :(

M
Mitov10 months ago

You are the "Coders" man :)

My ComfyUI Windows Portable installation has had some errors for the past 2 days, it is most likely to get the first error because of that... let's see if somebody else has had it.

S
Slava Borisovskiy6 months ago

When loading the graph, the following node types were not found:

  • FaceAnalysisModels
  • FaceSegmentation

I can’t install these nodes, it gives an error

O
Omar Salleh5 months ago

I'm having the same issue. :-(

Z
ZERO_Da month ago


IPAdapterUnifiedLoaderFaceID

ClipVision model not found.


A
Arkadiusza month ago

Getting errors each time, (I have a mask defined):

!!! Exception during processing !!! operands could not be broadcast together with shapes (800,4,1000) (800,3,1000)

Traceback (most recent call last):

 File "/home/arkadiusz/ComfyUI-working/execution.py", line 327, in execute

   output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 File "/home/arkadiusz/ComfyUI-working/execution.py", line 202, in get_output_data

   return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 File "/home/arkadiusz/ComfyUI-working/execution.py", line 174, in _map_node_over_list

   process_inputs(input_dict, i)

 File "/home/arkadiusz/ComfyUI-working/execution.py", line 163, in process_inputs

   results.append(getattr(obj, func)(**inputs))

                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 File "/home/arkadiusz/ComfyUI-working/custom_nodes/comfyUI_FrequencySeparation_RGB-HSV/frequency_combination.py", line 36, in combine

   v_combined = (2 * high + low - 1).clip(0, 1)

                 ~~~~~~~~~^~~~~

ValueError: operands could not be broadcast together with shapes (800,4,1000) (800,3,1000)



But apart from that I'm getting a completely changed face - tried with different values of cfg, but no luck.


老夫子a month ago

This workflow is very comprehensive and can provide four effects. The author is really amazing!I think the second effect is the closest to the original photo.

Author

33
122.6K
1.9K
363.5K

Reviews

No reviews yet

Versions (2)

  • - latest (10 months ago)

  • - v20240610-115950

Primitive Nodes (33)

FrequencyCombination (8)

FrequencySeparation (1)

FrequencySeparationHSV (1)

Image Comparer (rgthree) (5)

Note (16)

Reroute (2)

Custom Nodes (71)

ComfyUI

  • - MaskToImage (1)

  • - ControlNetLoader (1)

  • - CLIPTextEncode (4)

  • - PreviewImage (10)

  • - VAEEncode (3)

  • - ControlNetApply (1)

  • - LoadImageMask (1)

  • - KSampler (2)

  • - VAEDecode (2)

  • - LoadImage (1)

  • - ImageBatch (2)

  • - CheckpointLoaderSimple (1)

  • - PreviewBridge (3)

  • - DepthAnythingPreprocessor (1)

  • - IPAdapterUnifiedLoaderFaceID (1)

  • - IPAdapterFaceID (1)

  • - LoadAndApplyICLightUnet (1)

  • - ICLightConditioning (1)

  • - ColorMatchImage (5)

  • - BatchAverageImage (3)

  • - Int (3)

  • - FaceAnalysisModels (1)

  • - FaceSegmentation (1)

  • - RemapMaskRange (1)

  • - GrowMaskWithBlur (1)

  • - ImageBatchMulti (1)

  • - RemapImageRange (6)

  • - Image Blending Mode (6)

Checkpoints (1)

epicrealism_naturalSinRC1VAE.safetensors

LoRAs (0)