Body Swap in ComfyUI Using Qwen Image 2.1: Comparing Two LoRAs in a Single Workflow

Hello, creators and fellow artists! In this article, I’ll show you how to perform a body swap using the Qwen Image 2.1 model in ComfyUI.

Body swapping is a powerful image editing technique that allows you to transfer a character into a completely different scene while recreating the pose of another character.

One of the most interesting features of this workflow is its ability to generate two different body swap results in a single run using two different LoRAs. Rather than relying on a single LoRA, we can compare the results and choose the one that best meets our creative expectations.

Throughout this article, we’ll explore how the workflow operates, compare the performance of two body swap LoRAs, and discuss several important configurations that can help improve the quality of your generated images.

YouTube Tutorial:

Gain exclusive access to advanced ComfyUI workflows and resources by joining our community now!

Understanding Body Swap and Character Swap

What Is a Body Swap?

A body swap, also referred to as a character swap in this workflow, is the process of transferring a character from one image into another while adapting the character to the target scene.

Unlike a traditional face swap, which primarily focuses on replacing facial features, a body swap aims to transfer the character’s overall appearance while recreating the pose of the character in the target image.

Ideally, the generated image should preserve the following characteristics:

  • The identity and physical appearance of the source character.
  • The clothing and visual characteristics of the source character.
  • The body pose and head orientation of the target character.
  • The environment and composition of the target scene.
  • Natural body proportions, lighting, and shadows.

Achieving all these objectives simultaneously can be challenging, which is why choosing the right LoRA is important.

Body Reference Image vs. Scene Reference Image

This workflow requires two input images, each serving a different purpose.

Reference imagePurpose
Body Reference ImageProvides the character we want to transfer into another scene.
Scene Reference ImageProvides the target environment, composition, and character pose.

For example, suppose the body reference image contains a woman standing outdoors, while the scene reference image contains another woman sitting inside a room.

Our objective is to transfer the woman from the first image into the room while having her recreate the sitting pose of the woman in the second image.

The goal is not simply to place a character into a different background but to integrate the character naturally into the scene.

Generating Two Outputs in a Single Run

One of the key features of this workflow is that it generates two output images every time we execute it.

Each output is generated using a different body swap LoRA:

  • bfs Body Swap LoRA
  • oldx Body Swap LoRA

Although both LoRAs are designed to accomplish the same task, they interpret the reference images differently, resulting in noticeable variations in pose accuracy, color reproduction, lighting, and overall realism.

By generating both versions in a single run, we can easily compare their performance without having to manually switch between LoRAs and execute the workflow again.

Workflow Overview in ComfyUI

The workflow consists of two parallel image generation branches. Both branches receive the same reference images but use different body swap LoRAs and text prompts.

Conceptual overview of the dual-LoRA body swap workflow, rather than an exact ComfyUI node connection diagram.

This architecture allows us to evaluate two different approaches to body swapping while keeping the overall generation process consistent.

Dual Advanced Samplers and Manual Sigma Values

There are two samplers in this workflow, both of which are custom advanced samplers.

The main reason I chose advanced samplers instead of a conventional KSampler is that I wanted more control over the sigma values used during the sampling process.

Sigma values determine the noise levels at different stages of the denoising process. By manually configuring these values, we gain greater control over how the image is progressively generated and refined.

Based on my experiments, manually configuring the sigma values helps bring out more fine details in the generated images.

This can be particularly useful when generating complex character images containing clothing textures, facial features, accessories, and other subtle visual details.

Shared Sampling Parameters

Both advanced samplers share the same sampling parameters, including the following:

ParameterConfiguration
Noise seedIdentical
CFG valueIdentical
Sampling algorithmIdentical
Sigma configurationManually configured
Body swap LoRADifferent
Text promptDifferent
Sampling steps6

So, if both samplers share the same noise seed, CFG value, and sampling algorithm, why do they produce different results?

The primary reason is that each generation branch uses a different body swap LoRA, along with a corresponding text prompt.

Each LoRA has its own learned characteristics, which influence how the model interprets the reference images and reconstructs the character in the target scene.

3.5. Combining and Labeling Input and Output Images

I also included two nodes in the workflow to combine the input and output images and add labels to them.

The final comparison consists of four images arranged side by side.

The two images on the left are the original input images, while the two images on the right are the generated outputs.

This arrangement makes it much easier to evaluate the results, identify inconsistencies, and determine which LoRA performs better for a particular pair of reference images.

Comparing Two Body Swap LoRAs: bfs vs. oldx

The bfs Body Swap LoRA

The bfs LoRAs are quite popular within the AI image generation community.

The creator has also trained other LoRAs designed for specialized image editing tasks, including face swapping and head swapping.

The bfs body swap LoRA is capable of generating convincing character swaps and, in some cases, produces characters that appear more natural overall.

However, based on my experiments, it occasionally struggles to reproduce the exact pose and body proportions of the character in the scene reference image.

The oldx Body Swap LoRA

Compared with bfs, the oldx body swap LoRA is not as well known within the community.

However, after conducting numerous tests, I found that it actually performs better in many situations, particularly when it comes to reproducing the pose and head orientation of the target character.

It can also produce more visually appealing colors in certain scenarios.

That being said, oldx is not without its limitations. Some generated images may exhibit less natural clothing shading or retain unwanted accessories from the scene reference image.

Establishing a Consistent Testing Method

To better understand the strengths and weaknesses of these two LoRAs, I generated quite a few images using different pairs of reference images.

For each comparison, I followed this testing procedure:

  1. Select a pair of body and scene reference images.
  2. Generate images using both body swap LoRAs.
  3. Repeat the generation process at least three times using different noise seeds.
  4. Select the best result generated by each LoRA.
  5. Compare the selected results based on pose accuracy, color quality, realism, and visual consistency.

I chose this approach because a single generation may not accurately represent the capabilities of a particular LoRA.

Changing the noise seed can significantly influence the final result. By generating multiple images and selecting the best output from each setup, we can make a more useful comparison of what each LoRA is capable of achieving.

Of course, this is a practical, subjective comparison of selected results rather than a comprehensive performance benchmark.

Evaluating Body Swap Results Through Practical Examples

Example 1: Pose Accuracy and Consistency

In our first example, the objective is to transfer the woman from the body reference image into the environment of the scene reference image while recreating the target woman’s pose.

Both LoRAs successfully perform the body swap. However, there is a noticeable difference in the poses of the generated characters.

The pose generated using the bfs LoRA is not quite as consistent with the original pose in the scene reference image.

In comparison, the image generated using the oldx LoRA reproduces the target pose more accurately.

This is an important consideration, especially when working with reference images containing carefully composed or complex character poses.

For this particular example, I prefer the result generated using the oldx LoRA because of its stronger pose consistency.

Example 2: Reversing the Reference Images

For our second example, I used the same two input images but switched their roles.

In other words:

  • The previous body reference image becomes the scene reference image.
  • The previous scene reference image becomes the body reference image.

This creates a completely different body swap scenario without requiring any additional input images.

After generating the results, I noticed a difference in the color reproduction of the two outputs.

Personally, I think the colors in the image generated using the oldx LoRA look better.

Although both LoRAs are capable of producing usable results, this example demonstrates that their differences are not limited to pose accuracy. They can also influence the overall visual appearance and color quality of the generated image.

Example 3: Head Angle, Clothing Details, and Unwanted Elements

Our third example reveals several interesting differences between the two LoRAs.

First, the pose and head angle in the image generated using the oldx LoRA match the scene reference image more closely.

This is another example of oldx demonstrating stronger pose consistency.

However, when examining the clothing, I noticed that the woman’s crop top looks somewhat flat. It lacks the natural highlights and shadows that would normally help convey the shape and texture of the fabric.

Another issue is the camouflage wristband.

The wristband originally belongs to the woman in the scene reference image, but the model has unintentionally carried it over into the generated output.

This is an example of unwanted feature transfer, where elements belonging to the target character remain in the final image even though they are not part of the source character’s appearance.

Meanwhile, the image generated using the bfs LoRA is slightly less consistent with the target pose. However, the woman appears more natural overall.

This example highlights an important trade-off between the two LoRAs.

Greater pose accuracy does not necessarily translate into greater visual realism. Depending on the intended use of the generated image, you may prefer a more natural-looking character over one that reproduces the target pose more precisely.

Example 4: Pose Consistency and Body Proportions

In our final example, we once again observe a difference in pose accuracy.

The pose generated using the oldx LoRA matches the original pose in the scene reference image more closely.

In comparison, the woman’s head in the image generated using the bfs LoRA appears slightly too large relative to her body.

Maintaining realistic anatomical proportions is essential when performing a character swap, particularly when the generated image is intended for professional creative projects.

Even relatively subtle inconsistencies in head size or body proportions can make an otherwise convincing image appear unnatural.

For this example, I prefer the result generated using the oldx LoRA because of its stronger pose consistency and more convincing head-to-body proportions.

Strengths and Weaknesses of Both LoRAs

Based on these comparisons, it is clear that both LoRAs have their own strengths and weaknesses.

Evaluation criteriabfs LoRAoldx LoRA
Pose accuracyOccasionally deviates from the target poseGenerally more consistent in my tests
Head orientationMay differ from the scene referenceOften matches the target more closely
Color reproductionCapable of producing good resultsMore visually appealing in some examples
Natural appearanceMore natural in certain scenariosCan occasionally appear less natural
Clothing shadingProduced a more natural-looking character in one comparisonOccasionally lacks natural highlights and shadows
Body proportionsMay produce disproportionate featuresMore convincing proportions in the final example
Unwanted feature transferNot ruled out by these testsRetained an unwanted wristband in one example

Overall, I found that the oldx LoRA frequently performs better when pose accuracy is the primary objective.

However, the bfs LoRA can sometimes generate a more natural-looking character, even when the pose is slightly less accurate.

This is precisely why I designed the workflow to generate two output images instead of relying exclusively on one LoRA.

Having both options gives us greater creative flexibility and allows us to select the result that best suits our needs.

Important Workflow Configurations

Using Different Prompts for Each LoRA

There are two separate Text Encode nodes in this workflow.

One important thing to keep in mind is that you should use different prompts for these two body swap LoRAs.

Although both LoRAs are designed to perform the same task, their training approaches and learned behaviors may differ. Consequently, a prompt that works well with one LoRA may not produce equally effective results with the other.

Instead of connecting a single Text Encode node to both generation branches, I configured them independently.

This allows us to optimize the instructions for each LoRA without affecting the other branch.

When writing a body swap prompt, the main objectives are to communicate which character should be transferred, which scene should be preserved, and which pose should be recreated.

However, you should follow the recommended prompting format for the specific LoRA you are using rather than assuming that both LoRAs respond identically to the same instructions.

Removing the Background from the Body Reference Image

Another important component of this workflow is the background removal node.

Before the body reference image is used for image generation, its background is removed so that the model can focus more directly on the source character.

Without background removal, some unwanted elements from the original background may accidentally carry over into the generated output.

These could include furniture, environmental objects, background patterns, or other visual elements that do not belong in the target scene.

Conceptual illustration of isolating the source character before image generation.

By removing the background, we provide the model with a cleaner visual reference and reduce the likelihood of unwanted environmental elements being transferred into the final image.

Notice that this preprocessing step is applied to the body reference image, not the scene reference image.

We still want to preserve the environment and composition of the target scene, so removing its background would defeat part of the purpose of the body swap.

Background removal does not, however, guarantee that unwanted accessories belonging to the target character will also be eliminated.

Accelerating Image Generation with a Six-Step LoRA

In addition to the two body swap LoRAs, I am also using another LoRA that allows me to generate images in just six sampling steps.

The purpose of this additional LoRA is to accelerate the image generation process.

This is particularly beneficial for a workflow that generates two output images per execution and may be run repeatedly using different noise seeds.

Reducing the number of sampling steps makes experimentation more efficient, especially when working with multiple reference images or evaluating different body swap scenarios.

Combined with the manually configured sigma values, this setup allows me to generate images efficiently while achieving a satisfactory level of detail in my tests.

Final Thoughts

Performing a body swap using Qwen Image 2.1 in ComfyUI opens up a wide range of creative possibilities.

Whether you want to transfer a character into a different environment, recreate a specific pose, experiment with alternative compositions, or maintain character consistency across multiple scenes, this workflow provides a flexible approach to character swapping.

If you’d like to download this ComfyUI workflow and try it with your own reference images, feel free to join our community and support my work.

Gain exclusive access to advanced ComfyUI workflows and resources by joining our community now!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *