banner_image ×
SeaArt AI Enterprise Version

Import cv2 From MatplotLib Import Pyplot As PLT # Upload the image image

import cv2
From MatplotLib Import Pyplot As PLT

# Upload the image
image = cv2.imread('path/to/image.jpg')

# Load the pre-trained face detection model
modelo_deteccao = cv2. CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')

# Convert the image to grayscale
imagem_cinza = cv2.cvtColor(image, cv2. COLOR_BGR2GRAY)

# Detect the faces in the image
faces = modelo_deteccao.detectMultiScale(imagem_cinza, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30))

# Check if faces have been found
if len(faces) > 0:
    # Select only the first face found
    x, y, w, h = faces[0]
    
# Crop the face region
    face = image[y:y+h, x:x+w]
    
# Resize the face to the appearance of 16 years
    rosto_redimensionado = cv2.resize(face, (0, 0), fx=0.8, fy=0.8)
    
# Load the template body image
    modelo_corpo = cv2.imread('path/to/imagem_modelo.jpg')
    
# Resize the template body to the desired size
    modelo_corpo_redimensionado = cv2.resize(modelo_corpo, (w, h))
    
# Merge the resized face with the template body
    imagem_final = cv2.addWeighted(rosto_redimensionado, 0.5, modelo_corpo_redimensionado, 0.5, 0)
    
# Display the final image
    plt.imshow(cv2.cvtColor(imagem_final, cv2. COLOR_BGR2RGB))
    plt.axis('off')
    plt.show()
else:
    print("No face was found in the image.")
chatIcon
I've got something special just for you.
Create AI Character
image
avatar
A
Anderson Pacatubano
Prompts
Copy
import cv2 From MatplotLib Import Pyplot As PLT # Upload the image image = cv2 . imread('path/to/image . jpg') # Load the pre-trained face detection model modelo_deteccao = cv2 . CascadeClassifier(cv2 . data . haarcascades + 'haarcascade_frontalface_default . xml') # Convert the image to grayscale imagem_cinza = cv2 . cvtColor(image , cv2 . COLOR_BGR2GRAY) # Detect the faces in the image faces = modelo_deteccao . detectMultiScale(imagem_cinza , scaleFactor=1 . 1 , minNeighbors=5 , minSize=(30 , 30)) # Check if faces have been found if len(faces) > 0: # Select only the first face found x , y , w , h = faces[0] # Crop the face region face = image[y:y+h , x:x+w] # Resize the face to the appearance of 16 years rosto_redimensionado = cv2 . resize(face , (0 , 0) , fx=0 . 8 , fy=0 . 8) # Load the template body image modelo_corpo = cv2 . imread('path/to/imagem_modelo . jpg') # Resize the template body to the desired size modelo_corpo_redimensionado = cv2 . resize(modelo_corpo , (w , h)) # Merge the resized face with the template body imagem_final = cv2 . addWeighted(rosto_redimensionado , 0 . 5 , modelo_corpo_redimensionado , 0 . 5 , 0) # Display the final image plt . imshow(cv2 . cvtColor(imagem_final , cv2 . COLOR_BGR2RGB)) plt . axis('off') plt . show() else: print("No face was found in the image . ")
INFO
Prompts
import cv2 From MatplotLib Import Pyplot As PLT # Upload the image image = cv2.imread('path/to/image.jpg') # Load the pre-trained face detection model modelo_deteccao = cv2. CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') # Convert the image to grayscale imagem_cinza = cv2.cvtColor(image, cv2. COLOR_BGR2GRAY) # Detect the faces in the image faces = modelo_deteccao.detectMultiScale(imagem_cinza, scaleFactor=1.1, minNeighbors=5, minSize=(30, 30)) # Check if faces have been found if len(faces) > 0: # Select only the first face found x, y, w, h = faces[0] # Crop the face region face = image[y:y+h, x:x+w] # Resize the face to the appearance of 16 years rosto_redimensionado = cv2.resize(face, (0, 0), fx=0.8, fy=0.8) # Load the template body image modelo_corpo = cv2.imread('path/to/imagem_modelo.jpg') # Resize the template body to the desired size modelo_corpo_redimensionado = cv2.resize(modelo_corpo, (w, h)) # Merge the resized face with the template body imagem_final = cv2.addWeighted(rosto_redimensionado, 0.5, modelo_corpo_redimensionado, 0.5, 0) # Display the final image plt.imshow(cv2.cvtColor(imagem_final, cv2. COLOR_BGR2RGB)) plt.axis('off') plt.show() else: print("No face was found in the image.")
Negative Prompts
(nsfw:1.5),blind, lowres, extra limbs, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, afro, nude
CFG Scale
7
Steps
20
Sampler
Heun
Seed
-1
Clip Skip
Image Size
1152 X 2048
Denoising Strength
0.2
Model
Protogen x3.4 (Photorealism) Official Release
Generate
Size
1920X2560
Date
Jul 6, 2023
Mode
Default
Type
upscale
Checkpoint & LoRA
Protogen x3.4 (Photorealism) Official Release
Checkpoint
Protogen x3.4 (Photorealism) Official Release
LORA
Bdelphine-Lora-760x1024-V2
LORA
Nudify XL: Better Bodies
0 comment
0
0
0

SeaArt Swift AI Apps

ai_video_generationimg
AI Video Generation

Unleash your imagination and let AI create visual wonders for you

face_swap_titleimg
Face Swap Online Free

Create funny or realistic face swap videos & photos in a snap

video_face_swapimg
Video Face Swap

Create funny videos by swapping faces in any video clip.

ai_eraserimg
AI Eraser

Easily remove unwanted objects, watermarks, or people from your photos.

fuse_anyoneimg
AI Image Fusion

Combine two images into new one stunning visual with AI Image Fusion.

ghibli_filter_h1img
Studio Ghibli Filter

Transform any photo into unique Ghibli-style art in just one click.

Explore More AI Apps 

Explore Related

ControlNet
logo
English
Application
Create Image AI Characters Swift AI Model Training Canvas AI Apps Workflow
About
Studio Rankings AI Chat AI Blog AI News
Help
Guides Customer Service
Get App
icon
Download on the
APP Store
icon
GET IT ON
Google Play
Follow Us
iconiconiconiconiconiconiconicon
© 2025 SeaArt, Inc.
Copyright Policy
Terms
Privacy 特定商取引法 資金決済法に基づく表示
More