Skip to content

Commit

Permalink
update_names (modelscope#210)
Browse files Browse the repository at this point in the history
add inpainting acknowledge
  • Loading branch information
You-Cun authored Sep 11, 2023
1 parent a845f1f commit efa2844
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from facechain.utils import snapshot_download

from facechain.inference import preprocess_pose, GenPortrait
from facechain.inference_ipt import GenPortrait_ipt_new
from facechain.inference_inpaint import GenPortrait_inpaint
from facechain.train_text_to_image_lora import prepare_dataset, data_process_fn
from facechain.constants import neg_prompt, pos_prompt_with_cloth, pos_prompt_with_style, styles, cloth_prompt, \
pose_models, pose_examples, base_models
Expand Down Expand Up @@ -371,7 +371,7 @@ def launch_pipeline_inpaint(uuid,
use_post_process = True
use_stylization = False

gen_portrait = GenPortrait_ipt_new(in_path, strength, num_faces,
gen_portrait = GenPortrait_inpaint(in_path, strength, num_faces,
pos_prompt, neg_prompt, style_model_path,
multiplier_style, multiplier_human, use_main_model,
use_face_swap, use_post_process,
Expand Down
5 changes: 3 additions & 2 deletions facechain/inference_ipt.py → facechain/inference_inpaint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
# Modified from the original implementation at https://github.com/modelscope/facechain/pull/104.
import json
import os
import sys
Expand Down Expand Up @@ -669,7 +670,7 @@ def post_process_fn(use_post_process, swap_results_ori, selected_face, num_gen_i
return np.array(swap_results_ori)


class GenPortrait_ipt_new:
class GenPortrait_inpaint:
def __init__(self, inpaint_img, strength, num_faces,
pos_prompt, neg_prompt, style_model_path, multiplier_style, multiplier_human,
use_main_model=True, use_face_swap=True,
Expand Down Expand Up @@ -886,4 +887,4 @@ def change_extension_to_jpg(image_path):
directory = os.path.dirname(image_path)

new_image_path = os.path.join(directory, new_base_name)
return new_image_path
return new_image_path

0 comments on commit efa2844

Please sign in to comment.