I heard recentlybuttonWith the launch of image streaming, Bot has gained a new way of creation.
Today I finally got around to trying out the image streaming on the button platform.
I looked at the image stream tool and found aSmart face swapfunction, decided to use it to create a more popularPortrait(Intelligent Face Changing) AI Bot.
See the effect first
Left: User uploaded image
Middle picture: Template picture
Right: New personal photo generated by user-uploaded photo + template photo.
Next, let’s learn togetherHow to use button image stream to make portrait photography (intelligent face replacement) AI applicationBar.
How to create image stream for portrait photography (smart face swapping)?
Enter coze.cn in the browser address bar to enter the official website of Kouzi.
Click [Personal Space]-[Image Stream].
Enter the image stream interface and click [Create Image Stream] in the upper right corner.
A window for creating an image stream pops up. Enter the image stream name and image stream description and click [Confirm].
Image stream name: portrait_photography
Image stream description: When a user uploads a portrait photo, this image stream is called to help the user generate a personal portrait photo
Enter the image stream editing page. The left menu has three types of tools: smart generation, smart editing, and basic editing. The middle image stream editing area has the [Start] and [End] workflow modules by default.
This time we need to do the portrait photo (intelligent face changing) function, so we need to select the [Intelligent Face Changing] tool.
In order to make the generated pictures better, Guotou added the [Image Quality Enhancement] function.
Click the [+] icon on the right side of the [Smart Face Swap] and [Image Quality Improvement] items to add these two tools to the image stream.
Connect the cables in the order of [Start] -> [Smart Face Swap] -> [Image Quality Enhancement] -> [End].
start
At the starting node of the workflow, we need to define the input variable name, variable type, and description.
The settings of the pot head here are as follows:
Smart face swap
reference_picture_url (reference picture): The reference picture is the face reference for the image to be generated, usually the picture we uploaded. Here we directly reference the input_photo parameter value of the start module.
Skin (skin beautification effect): The range is [0,1]. The higher the value, the better the skin beautification effect. Since it is not required, Guotou will not fill it in here.
template_picture_url (template image): A template image is a picture in which a person’s face is placed. Here, Guotou directly chooses to upload a costume picture.
Improved image quality
It is used to improve the image clarity and make the image quality better. You need to input the image whose quality is to be improved. The parameter value is directly referenced by the intelligent face-changing-data output by the intelligent face-changing module.
Finish
The final node of the workflow is used to return the result information after the workflow is run.
We enter the parameter name output here, and the parameter value refers to the image quality improvement-data.
The configured image stream is shown in the figure below.
Trial run
Through trial running, we can debug whether our workflow is normal.
Click [Test Run] in the upper right corner.
After uploading an image, click [Run].
The operation was successful and we completed a face-changing operation.
The effect of Figure 1+Figure 2=Figure 3 is as follows:
It is a bit simple to generate one picture at a time, let's try to generate 4 portraits with changed faces at a time to see if it works.
The image flow arrangement is shown in the following figure.
The test run results are shown in the figure below, and it can run successfully. There is no problem with the image stream.
release
Confirm that the image stream configuration is correct and click [Publish].
Go back to Personal Space - Image Stream and see that the portrait_photography we just created has been successfully published.
How to create a portrait photography (smart face-changing) AI Bot?
Go back to the button homepage and click [+Create Bot].
The Create Bot window pops up. Select a workspace, fill in the Bot name and function description, upload the icon, and click [Confirm].
Bot name: Portrait (intelligent face-changing)
Bot function introduction: Upload a frontal portrait photo and automatically generate a portrait photo in ancient costume.
Icon: Automatically generated by AI or upload a photo yourself.
Go to the Portrait (Smart Face Changing) Bot editing page.
Character setting and response logic
# Role You are a professional portrait generation tool that can guide users to upload face photos, and then use the image stream portrait_photography to achieve intelligent face swapping, thereby generating realistic user portrait photos. ## Skills### Skill 1: Guide users to upload photos1. Prompt users to upload a clear face photo. ### Skill 2: Perform intelligent face swap1. After the user uploads the photo, call the image stream portrait_photography to perform intelligent face swapping. 2. Generate the user's portrait photo. ### Skill 3: Generate multiple pictures at a time1. Present all the pictures output by the image stream. ## Limitations: - Only focus on processing operations related to face photos and generating portrait photos. - The output content must be organized according to the given format and cannot deviate from the framework requirements.
Model setup
Select "Doubao·Function call model 32K" as the model.
Skill
Click [+] on the right side of the image popularity item.
Find the image stream portrait_photography we created and click [Add].
Added successfully.
Set the opening text as follows:
Welcome to use my professional portrait photo generator! I can help you generate personalized portrait photos. Please upload a clear face photo, I will perform intelligent face replacement for you and generate your portrait photo.
Preview and debug
Upload a face photo, and after running, 4 portrait photos are successfully generated.
release
Click [Publish] in the upper right corner.
Enter the publishing page. If there are no other platforms to publish to, continue to click [Publish].
After the release is successful, the uploaded image will generate the following effect:
So far, we have completed the image stream and AI Bot creation and publishing of portrait photography (intelligent face changing). Have you learned it?
Learning Summary
Let’s review and summarize what we have learned:
- Create a new "Portrait (Smart Face Changing)" image stream.
- Option language model "doubao·Function call model 32K".
- Edit personality and reply logic.
- Adding image streaming and opening remarks
- Preview and debug.
- Publish the Bot.
This wave is coming down,In the future, you can build your own AI portrait photography application by yourself. You can use any background and style you want. You can make it as beautiful or handsome as you want..