|
|
|
@ -28,12 +28,37 @@ def C26_get_sdxl_styles():
|
|
|
|
|
return SDXL_STYLES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def C26(prompt_data, img, source_code, target_code):
|
|
|
|
|
def C26(prompt_data, img):
|
|
|
|
|
# 原图
|
|
|
|
|
prompt_data["13"]["inputs"]["image"] = img[0]
|
|
|
|
|
|
|
|
|
|
['sai-3d-model', 'sai-analog film', 'sai-anime', 'sai-cinematic', 'sai-comic book', 'sai-craft clay',
|
|
|
|
|
'sai-digital art', 'sai-enhance', 'sai-fantasy art', 'sai-isometric', 'sai-line art', 'sai-lowpoly',
|
|
|
|
|
'sai-neonpunk', 'sai-origami', 'sai-photographic', 'sai-pixel art', 'sai-texture', 'ads-advertising',
|
|
|
|
|
'ads-automotive', 'ads-corporate', 'ads-fashion editorial', 'ads-food photography', 'ads-gourmet food photography',
|
|
|
|
|
'ads-luxury', 'ads-real estate', 'ads-retail', 'artstyle-abstract', 'artstyle-abstract expressionism',
|
|
|
|
|
'artstyle-art deco', 'artstyle-art nouveau', 'artstyle-constructivist', 'artstyle-cubist',
|
|
|
|
|
'artstyle-expressionist', 'artstyle-graffiti', 'artstyle-hyperrealism', 'artstyle-impressionist',
|
|
|
|
|
'artstyle-pointillism', 'artstyle-pop art', 'artstyle-psychedelic', 'artstyle-renaissance', 'artstyle-steampunk',
|
|
|
|
|
'artstyle-surrealist', 'artstyle-typography', 'artstyle-watercolor', 'futuristic-biomechanical',
|
|
|
|
|
'futuristic-biomechanical cyberpunk', 'futuristic-cybernetic', 'futuristic-cybernetic robot',
|
|
|
|
|
'futuristic-cyberpunk cityscape', 'futuristic-futuristic', 'futuristic-retro cyberpunk',
|
|
|
|
|
'futuristic-retro futurism', 'futuristic-sci-fi', 'futuristic-vaporwave', 'game-bubble bobble',
|
|
|
|
|
'game-cyberpunk game', 'game-fighting game', 'game-gta', 'game-mario', 'game-minecraft', 'game-pokemon',
|
|
|
|
|
'game-retro arcade', 'game-retro game', 'game-rpg fantasy game', 'game-strategy game', 'game-streetfighter',
|
|
|
|
|
'game-zelda', 'misc-architectural', 'misc-disco', 'misc-dreamscape', 'misc-dystopian', 'misc-fairy tale',
|
|
|
|
|
'misc-gothic', 'misc-grunge', 'misc-horror', 'misc-kawaii', 'misc-lovecraftian', 'misc-macabre', 'misc-manga',
|
|
|
|
|
'misc-metropolis', 'misc-minimalist', 'misc-monochrome', 'misc-nautical', 'misc-space', 'misc-stained glass',
|
|
|
|
|
'misc-techwear fashion', 'misc-tribal', 'misc-zentangle', 'papercraft-collage', 'papercraft-flat papercut',
|
|
|
|
|
'papercraft-kirigami', 'papercraft-paper mache', 'papercraft-paper quilling', 'papercraft-papercut collage',
|
|
|
|
|
'papercraft-papercut shadow box', 'papercraft-stacked papercut', 'papercraft-thick layered papercut',
|
|
|
|
|
'photo-alien', 'photo-film noir', 'photo-glamour', 'photo-hdr', 'photo-iphone photographic', 'photo-long exposure',
|
|
|
|
|
'photo-neon noir', 'photo-silhouette', 'photo-tilt-shift']
|
|
|
|
|
|
|
|
|
|
# 风格图片
|
|
|
|
|
SDXL_STYLES = C26_get_sdxl_styles()
|
|
|
|
|
|
|
|
|
|
print(SDXL_STYLES)
|
|
|
|
|
idx = random.randint(0, len(SDXL_STYLES)-1)
|
|
|
|
|
prompt_data["79"]["inputs"]["style"] = SDXL_STYLES[idx]
|
|
|
|
|
|
|
|
|
@ -61,12 +86,10 @@ def runComfyUI(json_file, model_id, task_type_code, input_image, source_code, ta
|
|
|
|
|
with open(json_file, 'r', encoding="utf-8") as fi:
|
|
|
|
|
prompt_data = json.load(fi)
|
|
|
|
|
|
|
|
|
|
prompt_data, myfilter = C26(prompt_data, img, source_code, target_code)
|
|
|
|
|
prompt_data, myfilter = C26(prompt_data, img)
|
|
|
|
|
|
|
|
|
|
print(prompt_data)
|
|
|
|
|
# 生成
|
|
|
|
|
files = generate_clip(server_address, prompt_data, client_id, output_path, myfilter)
|
|
|
|
|
print(files)
|
|
|
|
|
generate_clip(server_address, prompt_data, client_id, output_path, myfilter)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
@ -83,11 +106,7 @@ if __name__ == '__main__':
|
|
|
|
|
model_id = 26
|
|
|
|
|
# 半身
|
|
|
|
|
# https://www.esheep.com/app/1890?utm_source=app_tab
|
|
|
|
|
# input_images = [['../Image/wife.jpg'], ['../Image/xiao2.jpg'], ['../Image/xiaoqiao.jpg']]
|
|
|
|
|
# input_images = [['../Image/xiao2.png']]
|
|
|
|
|
input_images = [['../Image/wife.jpg']]
|
|
|
|
|
# input_image = ['../ShlImages/shl_xs_1.jpg']
|
|
|
|
|
# input_image = ['../ShlImages/shl_xs_2.jpg']
|
|
|
|
|
|
|
|
|
|
# 使用哪个文件
|
|
|
|
|
json_file = '../JSON/' + str(model_id) + '.json'
|
|
|
|
|