# Image Conversion

**Thinking Process:**

Comfyui's Image conversion is similar to webui's Img2Img, where an original image is uploaded and its style is modified through the model. However, to enhance the precision of the conversion, we can add a few new steps:

> **I. Add a model magnification node to control the size of the original image.**&#x20;
>
> **II. Increase similarity to the original image:**&#x20;
>
> a. Use ipadapter faceid to reference facial features.&#x20;
>
> b. Reverse-engineer the original image prompts.&#x20;
>
> c. Add ControlNet (openpose, canny, depth).&#x20;
>
> **III. Upscale the final Image**

<figure><img src="/files/IdplIjLVeQQ2hy7s6o3o" alt="ComfyUI Image Conversion Process"><figcaption></figcaption></figure>

### Step 1: Build the Model Group

We can start building on the basis of the Img2Img template. First, selectively add an "Upscale Image By" node behind the original image to control the size of the original image. Lora can be added according to individual needs, or not added at all. Add a "CLIP Set Last Layer" node according to your needs, which can also be omitted. This node allows skipping of layers, and finally, connect the corresponding nodes.

**Add nodes:**

Upscale Image By&#x20;

CLIP Set Last Layer

### Step 2: Reference the Original Image

<mark style="background-color:yellow;">**(Reverse-engineer prompts + Ipadapter + Control Net)**</mark>

1. Reverse-engineer prompts: **WD14 Tagger node**&#x20;

Double-click to search and add the WD14 Tagger node.&#x20;

Connect the image node.&#x20;

Right-click on the positive prompts node and select "**Convert text to input**" to connect the WD14 Tagger to the positive prompts node.

<figure><img src="/files/QLqSCTKElKt0JR1A26If" alt="ComfyUI Image Conversion - BReverse-engineer Prompts: WD14 Tagger Node 1" width="563"><figcaption></figcaption></figure>

However, this only includes the prompts from the image. If you want to add other prompts, You need to create a new **Text Concatenate** node, which can connect multiple segments of prompts together.&#x20;

Then create a new **Primitive** node. The Primitive node can be connected to any node to become a related attribute.&#x20;

Enter additional prompts on the Primitive, such as Lora Trigger Words, some quality words, etc.

<figure><img src="/files/f322zx4X5l9smSgN40oJ" alt="ComfyUI Image Conversion - BReverse-engineer Prompts: WD14 Tagger Node 2" width="362"><figcaption></figcaption></figure>

<figure><img src="/files/6YbI0d0Q7P4DeXzzcxxf" alt="ComfyUI Image Conversion - BReverse-engineer Prompts: WD14 Tagger Node 3" width="563"><figcaption></figcaption></figure>

At this point, the prompts not only include the ones reverse-engineered from the image but also those we input.

2. Next, set up the **IPadapter FaceID** to reference facial features:&#x20;

Double-click to search for IPadapter FaceID and match the input nodes accordingly.

<figure><img src="/files/Ta1Lsz1QSJQOHpdszDAk" alt="ComfyUI Image Conversion - Set up the IPadapter FaceID to Reference Facial Features"><figcaption></figcaption></figure>

After dragging out the node, create new nodes:

ipadapter→ IPAdapter Model Loader&#x20;

clip\_vision→ Load CLIP Vision&#x20;

insightface→ IPAdapter InsightFace Loader

Connect the output to the sampler.

**Add nodes:**

IPadapter FaceID

IPAdapter Model Loader

Load CLIP Vision

IPAdapter InsightFace Loader

3. **Set up the ControlNet**&#x20;

It is recommended to use the **CR Multi-ControlNet Stack** node, which allows the addition of multiple ControlNets. Then add the corresponding preprocessors. It is recommended to use **OpenPose, Canny, and Depth** as the ControlNet. You can add or remove them based on the final visual needs. Afterwards, add a ControlNet application node at the output: **CR Apply Multi-ControlNet**. It is recommended to set the resolution at the preprocessor to **1024**.&#x20;

<mark style="background-color:yellow;">\*Finally, remember to turn on the switches of the ControlNet that will be used.</mark>

<figure><img src="/files/Cccx7PI3VQ1HuI83myfu" alt="ComfyUI Image Conversion - Set up the ControlNet" width="563"><figcaption></figcaption></figure>

**Input:**&#x20;

Connected to the positive and negative prompt nodes.

&#x20;**Output:**&#x20;

Connected to the sampler.

**Add nodes:**

CR Multi-ControlNet Stack

CR Apply Multi-ControlNet

### Step 3: High-Definition Restoration

After the model group and reference to the original image have been set up, we can add an image high-definition restoration step at the final output of the image:

<figure><img src="/files/37J6bQaHd0RPYXo1GK1P" alt="ComfyUI Image Conversion - High-Definition Restoration" width="562"><figcaption></figcaption></figure>

**Add Nodes:** Upscale Image (using Model)

After assembling the nodes, you can organize them into a group for easier viewing.

<figure><img src="/files/SCO6wUQjLPeXdyfI0W9D" alt="ComfyUI Image Conversion - Add Nodes to Upscale Image 2"><figcaption></figcaption></figure>

Finally, it's necessary to adjust the relevant parameters based on the output image, <mark style="background-color:yellow;">such as ckpt, Lora weights, prompt words, sampler, redraw scale, etc.</mark>&#x20;

**Key parameters for this conversion include:**&#x20;

CLIP \_layer：-2&#x20;

Upscale Image By: 1.5&#x20;

steps: 40&#x20;

sampler\_name: dpmpp\_2m&#x20;

scheduler: karras&#x20;

denoise: 0.7

<mark style="color:red;">Note: If you choose the SDXL model, you will also need the corresponding SDXL Lora, and adjust the ControlNet to SDXL; otherwise, the image output will fail.</mark>

<figure><img src="/files/KXV0PncM44kRIrB7tZq2" alt="ComfyUI Image Conversion - Corresponding SDXL Lora" width="239"><figcaption></figcaption></figure>

The above is a complete workflow for image conversion. Based on this, you can also add VAE or FreeU\_V2 to adjust the final image:&#x20;

**FreeU\_V2:** Mainly controls color and extracts some content for optimization.&#x20;

**Load VAE:** Fine-tunes the color and details of the image.

Through such a workflow, you can achieve conversions to different styles.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.seaart.ai/guide-1/3-advanced-guide/3-3-workflow-guide/image-conversion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
