Comfyui Advanced Tutorial 04 - Object Migration

AI Told www.youtube.com

Brief Summary

This video provides a comprehensive guide on object migration using ComfyUI, demonstrating how to seamlessly integrate objects into different environments. It covers masking techniques, parameter adjustments, and troubleshooting common issues like dark auras and logo distortions. The tutorial also explores various applications, including virtual try-ons and text integration, offering practical solutions and tips for achieving realistic results.

  • Object migration using ComfyUI is possible in less than 10 minutes.
  • Key parameters include buffer value, mask expand, and brush hardness.
  • Common issues like dark auras and logo distortions can be fixed with Gaussian blur and targeted repainting.

Introduction

The video introduces a method for seamlessly integrating objects into different environments using ComfyUI, aiming to simplify and expedite the process, traditionally requiring Blender, Photoshop, or other 3D tools. The goal is to achieve realistic object migration in under 10 minutes, showcasing the workflow's capabilities and efficiency.

Masking Techniques

The process begins with loading the object image and the target environment image into two separate load image nodes. The object is then fully masked using the mask editor with a 100% hardness brush. Next, the target image is opened, and the area where the object will be placed is masked, using a brush with varying hardness (50% to 100%) to blend the object and create realistic shadows, considering the light source in the environment.

Parameter Adjustments

The buffer value is the most important parameter, adjusting the context window; larger target areas require higher values (256 or 512), while smaller areas need lower values (128 or 64). The mask expand parameter can be increased from 0 to 6 to avoid missing small edge areas. The output size adjusts the output resolution and can be kept unchanged. The prompt is less important when using Redux, but can describe changes. The video also mentions the necessity of having Load Clip Vision and Redux installed, with links provided in the description.

Workflow and Fixes

The workflow displays images from different perspectives, including the context window and final image comparison. A common issue with the initial workflow was a dark aura around the migrated object, which was fixed by adding a Gaussian blur mask and adjusting the brush hardness. The more blur applied, the better the blending. Small unfixable dark areas may require minor adjustments in Photoshop.

Logo Correction

To correct the logo, a workflow without blur fixes is used. By masking only the logo on both images with lower buffer parameters, the logo can be enhanced. Text issues can be fixed by repainting, provided the text isn't too complex. The video provides two workflows: one with and one without blur fixes.

Object Integration Examples

Several examples of object integration are shown, including shoes in different scenes, with specific buffer values provided. Larger objects work well with a buffer value of 512. Errors may occur if the target area is too large compared to the reference object, which can be fixed with object removal techniques.

Brush Hardness

Brush hardness affects the output; 100% hardness maintains the object's original position, while 75% provides better smoothness. Using 100% hardness initially and then switching to 75% for variations is recommended.

Random Object Placement

Objects can be placed in random areas by painting the desired area and shadows with 50% hardness. However, this may result in unwanted objects. Using 100% hardness eliminates these errors, realistically migrating the shadow and object, though repainting the logo for higher details may be necessary.

Virtual Try-On

For virtual try-ons, the clothes of a brand are painted onto a target person. A buffer value of 512 is used, but the logo may be distorted. This can be fixed by saving the image, re-uploading it to the workflow, and repainting the logo.

Text Migration

Text can be migrated onto complex surfaces, but success depends on the complexity of the text and surface. The text to be transferred is painted, along with the target area, using a 50% hardness brush, especially if the target area is blurry.

Conclusion

The video acknowledges the effort in testing and refining the workflow, crediting the original creator and providing a link to their page. The next video will likely cover depth maps.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the Apple Store
Get it on Google Play

Transcript

Full transcript of “Comfyui Advanced Tutorial 04 - Object Migration”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.

0:00 Welcome to another episode of advanced comfy UI series. Today's topic is object migration. Let me simplify this. Have you wondered is it possible to put your brand object to any environment? What programs you would need to make this real? You need Blender, Photoshop, any other 3D tools. Even if you know all of this, how much time you will spend? Today we will combine this and get it less than 10 minutes. Revolutionary, right? Time to see the workflow and understand its capabilities. First, we have two load image nodes. First one is where you put your object image. The second one is the target, the environment you want to put object. We will put our object and must open mask

0:47 editor and mask the object fully. We use 100% hardness for the brush for this task. [Music] After that we open the target image and mask the area where we want to put the object. We use different hardness brush for this. Sometimes 100% sometimes 50%. I am using 50% hardness on this to blend better. I paint where the object will be and also painting the shadows. According to the image the shadow will be on the left. You should imagine how it should be. Now it is time to see the parameters. The buffer value which adjusts the context window. It is the most important parameter. If your target is big area, it should be like 256 or 512. If your

1:35 target is small, you should use 128 or 64. The multiples of 16 can be used. I will leave at the notes on the workflow. Mask expand. If you think you can miss small area on edges, you should increase it from 0 to six, but I will use at the zero. Output size which adjust output resolution. We will keep it unchanged. The prompt which is not so important because we will use Redux. However, you can say what is changing. Down there there is load section. I will give the necessary links. You should be aware that there is load clip vision and redux. So you should have them and put. I will not explain the downside. Not necessary. Time to explain top right side. Here we see your image from different perspectives. I only looked

2:22 the first one and third one and also final image. First one shows like the context window you see. Third one is the final image compare. Rest of them also you can look if you want to. This workflow was problematic that even if it did the object migration there was dark aura on the outside. I fixed it by adding Gaussian blur mask and adjust the brush hardness. Remember this. The more you use blur better it blends. At the end we have result section the end result which we will save. You can see that we have still small dark area which cannot be fixed. Just small adjustment on Photoshop will fix it later. The result was amazing. It even know where the light come from and make the shadows from 2D object to 3D with the

3:08 environment we want. Just small fix we have to do. We will repaint the logo and make the logo resolution higher and make more correct. So to correct our logo I am using workflow without the blur fixes. I gave you this workflow too. You see we have two with and without blur fix. Now with these parameters with lower buffer it is simple. We mask only the logo to change on both images. After that you see we have made it but we have only small issue which is text. As you can see the text can be fixed as long as it is not too complex. I mean that you can correct all text by repainting it. But if it is like this shape, it couldn't be read. I will show you how I integrate the text also on the following minutes. Now let me show you some different examples for integrating

3:56 objects. You should be aware of buffer values I'm giving you now. Now I will give you the object and the scene photo to be integrated and results. First one is shoes. In this environment also settings are written. You see with buffer value of 512 with big objects works well. Now again 512 buffer different scene. You see we have small error. Usually there are no errors but if the target is too big compared to reference object this occurs. I will fix it with object removal later. Now I will show you how the brush hardness affects the output. The more you close to 100% brush hardness the more your object position will be familiar. But in case of smoothness, it

4:41 is better to be like 75% brush hardness. Choice is yours. I recommend 100% first and 75% if you want variation. Now you can ask me this question. What if we want our object to be at random place? Not the same type of object just the random space. Can we do that? Yes, absolutely. Let me show you how. You see, I painted random area also the shadows with 50% hardness. The result is good. Although we have unwanted object here. The reason is we used 50% hardness. What if we make hardness 100%. No errors. Realistically the shadow and object migrated. Just we should repaint the logo and make higher details. Now it is time for virtual tryon. Here we paint

5:27 the clothes of our brand and the target person. With the 512 buffer value, we succeed. But the logo is ruined. How to fix that? Easy. Just save our image and put it again to workflow and just paint the logo. After a couple minutes, it is done. Now the last thing I want to show you is how to migrate the text on any surface like complex one. But note that you cannot migrate all complex shapes and texts. It is depends on the complexity. Just paint the text you want to transfer and paint the area you want to put but make hardness 50%. It is also depending but if it is much blur where you target

6:15 it is better to make hardness 50% of the brush then you won. Well, testing many parameters and fixing this workflow was not easy. The workflow was not mine. I just fixed and explained it. Do not forget to visit the owner of the workflow. I will leave the link. Next video probably will be about the depth map. Thank you for watching.

Share

More video summaries