From aa8250e5d2a4020c0307e9da88cc331aec53413d Mon Sep 17 00:00:00 2001 From: hanzhn Date: Wed, 29 May 2024 10:30:04 +0800 Subject: [PATCH] v1.0.0 update --- docs/en/tutorials/dataset.md | 2 +- readme.md | 2 +- scepter/methods/edit/edit_512_lora.yaml | 2 +- scepter/methods/studio/home/home.yaml | 4 ++-- .../inference/edit/stylebooth_tb_pro.yaml | 2 +- .../studio/inference/largen/largen_pro.yaml | 6 +++--- scepter/methods/studio/scepter_ui.yaml | 4 ++-- .../self_train/edit/stylebooth_tb_pro.yaml | 2 +- .../caption_editor_ui/component_names.py | 18 ++++++++++-------- .../caption_editor_ui/create_dataset_ui.py | 6 +++--- .../tuner_manager/manager_ui/browser_ui.py | 6 +++++- 11 files changed, 30 insertions(+), 24 deletions(-) diff --git a/docs/en/tutorials/dataset.md b/docs/en/tutorials/dataset.md index 9c13c33..24bffa4 100644 --- a/docs/en/tutorials/dataset.md +++ b/docs/en/tutorials/dataset.md @@ -5,7 +5,7 @@ Below are examples for each format, illustrating their details and basic usage. ## Modelscope Format -We use a [custom-stylized dataset](https://modelscope.cn/datasets/damo/style_custom_dataset/summary), which included classes 3D, anime, flat illustration, oil painting, sketch, and watercolor, each with 30 image-text pairs. +We use a [custom-stylized dataset](https://modelscope.cn/datasets/iic/style_custom_dataset/summary), which included classes 3D, anime, flat illustration, oil painting, sketch, and watercolor, each with 30 image-text pairs. ```python # pip install modelscope diff --git a/readme.md b/readme.md index 9e9aa0e..3bbeabc 100644 --- a/readme.md +++ b/readme.md @@ -145,7 +145,7 @@ Therefore, subsequent startups will become much faster (about one minute) as dow ### Modelscope Studio & Huggingface Space -We deploy a work studio on Modelscope that includes only the inference tab, please refer to [ms_scepter_studio](https://www.modelscope.cn/studios/damo/scepter_studio/summary) and [hf_scepter_studio](https://huggingface.co/spaces/modelscope/scepter_studio) +We deploy a work studio on Modelscope that includes only the inference tab, please refer to [ms_scepter_studio](https://www.modelscope.cn/studios/iic/scepter_studio/summary) and [hf_scepter_studio](https://huggingface.co/spaces/modelscope/scepter_studio) ## 🔍 Learn More diff --git a/scepter/methods/edit/edit_512_lora.yaml b/scepter/methods/edit/edit_512_lora.yaml index 5f68804..c18310c 100644 --- a/scepter/methods/edit/edit_512_lora.yaml +++ b/scepter/methods/edit/edit_512_lora.yaml @@ -37,7 +37,7 @@ SOLVER: TIMESTEPS: 1000 MIN_SNR_GAMMA: ZERO_TERMINAL_SNR: False - PRETRAINED_MODEL: ms://damo/stylebooth@models/stylebooth-tb-5000-0.bin + PRETRAINED_MODEL: ms://iic/stylebooth@models/stylebooth-tb-5000-0.bin IGNORE_KEYS: [ ] CONCAT_NO_SCALE_FACTOR: True SCALE_FACTOR: 0.18215 diff --git a/scepter/methods/studio/home/home.yaml b/scepter/methods/studio/home/home.yaml index 61ebabc..d9a28e1 100644 --- a/scepter/methods/studio/home/home.yaml +++ b/scepter/methods/studio/home/home.yaml @@ -10,7 +10,7 @@ DESC_INFO: @@ -22,7 +22,7 @@ DESC_INFO:
- +

SCEPTER Studio是基于开源基模型和自研微调编辑算法构建的生成定制和编辑工具箱,提供围绕生成、微调、编辑、数据处理等一系列的工具和插件。

diff --git a/scepter/methods/studio/inference/edit/stylebooth_tb_pro.yaml b/scepter/methods/studio/inference/edit/stylebooth_tb_pro.yaml index ecc297b..c0ae415 100644 --- a/scepter/methods/studio/inference/edit/stylebooth_tb_pro.yaml +++ b/scepter/methods/studio/inference/edit/stylebooth_tb_pro.yaml @@ -49,7 +49,7 @@ DEFAULT_PARAS: INPUT: ["PROMPT", "NEGATIVE_PROMPT"] MODEL: - PRETRAINED_MODEL: ms://damo/stylebooth@models/stylebooth-tb-5000-0.bin + PRETRAINED_MODEL: ms://iic/stylebooth@models/stylebooth-tb-5000-0.bin SCHEDULE: PARAMETERIZATION: "eps" TIMESTEPS: 1000 diff --git a/scepter/methods/studio/inference/largen/largen_pro.yaml b/scepter/methods/studio/inference/largen/largen_pro.yaml index 27ca4b4..99d9bcc 100644 --- a/scepter/methods/studio/inference/largen/largen_pro.yaml +++ b/scepter/methods/studio/inference/largen/largen_pro.yaml @@ -68,7 +68,7 @@ DEFAULT_PARAS: INPUT: ["ORIGINAL_SIZE_AS_TUPLE", "AESTHETIC_SCORE", "NEGATIVE_AESTHETIC_SCORE", "CROP_COORDS_TOP_LEFT", "PROMPT", "NEGATIVE_PROMPT"] MODEL: - PRETRAINED_MODEL: ms://damo/LARGEN@models/largen_ckpt_s22k.pth + PRETRAINED_MODEL: ms://iic/LARGEN@models/largen_ckpt_s22k.pth # SCHEDULE_ARGS DESCRIPTION: TYPE: default: '' SCHEDULE: PARAMETERIZATION: "eps" @@ -245,8 +245,8 @@ MODEL: LEGACY_UCG_VALUE: - NAME: IPAdapterPlusEmbedder - CLIP_DIR: ms://damo/LARGEN@models/clip_encoder/ - PRETRAINED_MODEL: ms://damo/LARGEN@models/ip-adapter-plus_sdxl_vit-h.bin + CLIP_DIR: ms://iic/LARGEN@models/clip_encoder/ + PRETRAINED_MODEL: ms://iic/LARGEN@models/ip-adapter-plus_sdxl_vit-h.bin INPUT_KEYS: [ "ref_ip", "ref_detail" ] IN_DIM: 1280 HEADS: 20 diff --git a/scepter/methods/studio/scepter_ui.yaml b/scepter/methods/studio/scepter_ui.yaml index 03eeb9c..b5660f5 100644 --- a/scepter/methods/studio/scepter_ui.yaml +++ b/scepter/methods/studio/scepter_ui.yaml @@ -48,11 +48,11 @@ BANNER: |
- scepter_github_qr + scepter_github_qr
diff --git a/scepter/methods/studio/self_train/edit/stylebooth_tb_pro.yaml b/scepter/methods/studio/self_train/edit/stylebooth_tb_pro.yaml index c2ebb25..3b75264 100644 --- a/scepter/methods/studio/self_train/edit/stylebooth_tb_pro.yaml +++ b/scepter/methods/studio/self_train/edit/stylebooth_tb_pro.yaml @@ -160,7 +160,7 @@ SOLVER: TIMESTEPS: 1000 MIN_SNR_GAMMA: ZERO_TERMINAL_SNR: False - PRETRAINED_MODEL: ms://damo/stylebooth@models/stylebooth-tb-5000-0.bin + PRETRAINED_MODEL: ms://iic/stylebooth@models/stylebooth-tb-5000-0.bin IGNORE_KEYS: [ ] CONCAT_NO_SCALE_FACTOR: True SCALE_FACTOR: 0.18215 diff --git a/scepter/studio/preprocess/caption_editor_ui/component_names.py b/scepter/studio/preprocess/caption_editor_ui/component_names.py index 76e4464..c655b86 100644 --- a/scepter/studio/preprocess/caption_editor_ui/component_names.py +++ b/scepter/studio/preprocess/caption_editor_ui/component_names.py @@ -32,11 +32,12 @@ class CreateDatasetUIName(): self.default_dataset_repo = 'https://www.modelscope.cn/api/v1/models/iic/scepter/' self.default_dataset_zip = { 'scepter_txt2img': - f' {self.default_dataset_repo}repo?Revision=master&FilePath=datasets/3D_example_csv.zip ', + f'{self.default_dataset_repo}repo?Revision=master&FilePath=datasets/3D_example_csv.zip', 'scepter_img2img': - f' {self.default_dataset_repo}repo?Revision=master&FilePath=datasets/hed_pair.zip ' + f'{self.default_dataset_repo}repo?Revision=master&FilePath=datasets/hed_pair.zip' } - self.default_dataset_zip = ' and '.join([f"[{k}]({v})" for k, v in self.default_dataset_zip.items()]) + self.default_dataset_zip_str = ' and '.join( + [f'[{k}]({v})' for k, v in self.default_dataset_zip.items()]) self.default_dataset_name = { 'scepter_txt2img': '3D_example', @@ -56,7 +57,7 @@ class CreateDatasetUIName(): 'The first line is Target:FILE, Prompt, followed by the format of each line: image path, description.' 'we also surpport the zip of ' 'one level subfolder of images whose format are in jpg, jpeg, png, webp. ' - f'See the ZIP examples: {self.default_dataset_zip}. \n' # noqa + f'See the ZIP examples: {self.default_dataset_zip_str}. \n' # noqa f'* If you have refreshed the page, please click the {self.refresh_list_button} ' 'button to ensure all previously created datasets are visible in the dropdown menu.\n' '* For processing and training with large-scale data(for example more than 10K samples), ' @@ -105,11 +106,12 @@ class CreateDatasetUIName(): self.default_dataset_repo = 'https://www.modelscope.cn/api/v1/models/iic/scepter/' self.default_dataset_zip = { 'scepter_txt2img': - f' {self.default_dataset_repo}repo?Revision=master&FilePath=datasets/3D_example_csv.zip ', + f'{self.default_dataset_repo}repo?Revision=master&FilePath=datasets/3D_example_csv.zip', 'scepter_img2img': - f' {self.default_dataset_repo}repo?Revision=master&FilePath=datasets/hed_pair.zip ' + f'{self.default_dataset_repo}repo?Revision=master&FilePath=datasets/hed_pair.zip' } - self.default_dataset_zip = ' 和 '.join([f"[{k}]({v})" for k, v in self.default_dataset_zip.items()]) + self.default_dataset_zip_str = ' 和 '.join( + [f'[{k}]({v})' for k, v in self.default_dataset_zip.items()]) self.default_dataset_name = { 'scepter_txt2img': '3D_example', @@ -123,7 +125,7 @@ class CreateDatasetUIName(): f'* {self.btn_create_datasets_from_file} 按钮支持从文件中来新建数据集,目前支持zip文件,' '需要保证在文件夹外进行打包,并包含images/文件夹和train.csv(会使用该文件中的图片路径),首行为Target:FILE,Prompt,' '其次每行格式为:图片路径,描述;' - f'同时我们也支持图像文件的zip包,格式在jpg、jpeg、png或webp。数据ZIP样例路径:{self.default_dataset_zip}. \n' + f'同时我们也支持图像文件的zip包,格式在jpg、jpeg、png或webp。数据ZIP样例路径:{self.default_dataset_zip_str}. \n' + f'* 如果刷新了页面,请点击{self.refresh_list_button} 按钮以确保所有以往创建的数据集在下拉框中可见。\n' '* 对于大规模数据的处理和训练(数据规模大于1万),建议使用命令行形式\n' diff --git a/scepter/studio/preprocess/caption_editor_ui/create_dataset_ui.py b/scepter/studio/preprocess/caption_editor_ui/create_dataset_ui.py index 9a764ef..91bfee9 100644 --- a/scepter/studio/preprocess/caption_editor_ui/create_dataset_ui.py +++ b/scepter/studio/preprocess/caption_editor_ui/create_dataset_ui.py @@ -6,9 +6,9 @@ import datetime import os.path from collections import OrderedDict +import gradio as gr from tqdm import tqdm -import gradio as gr from scepter.modules.utils.file_system import FS from scepter.studio.preprocess.caption_editor_ui.component_names import \ CreateDatasetUIName @@ -25,7 +25,7 @@ def wget_file(file_url, save_file): if 'oss' in file_url: file_url = file_url.split('?')[0] local_path, _ = FS.map_to_local(save_file) - res = os.popen(f"wget -c '{file_url}' -O '{local_path}'") + res = os.popen(f"wget -c '{file_url.strip()}' -O '{local_path.strip()}'") res.readlines() FS.put_object_from_local_file(local_path, save_file) return save_file, res @@ -239,7 +239,7 @@ class CreateDatasetUI(UIBase): label=self.components_name.zip_file_url, value='', placeholder=self.components_name. - default_dataset_zip, + default_dataset_zip_str, visible=False) with gr.Column(scale=1, visible=False, min_width=0) as btn_panel: diff --git a/scepter/studio/tuner_manager/manager_ui/browser_ui.py b/scepter/studio/tuner_manager/manager_ui/browser_ui.py index 271f4d9..d485e67 100644 --- a/scepter/studio/tuner_manager/manager_ui/browser_ui.py +++ b/scepter/studio/tuner_manager/manager_ui/browser_ui.py @@ -863,12 +863,16 @@ class BrowserUI(UIBase): local_work_dir, _ = FS.map_to_local(src_path) FS.get_dir_to_local_dir(src_path, local_work_dir) + meta_file = f'{local_work_dir}/{username}/{modelid}/params.yaml' + if not os.path.exists(meta_file): + raise gr.Error( + 'The tuner model failed to be downloaded from ModelScope!') + gr.Info( 'The tuner model has been downloaded from ModelScope Successfully!' ) # - meta_file = f'{local_work_dir}/{username}/{modelid}/params.yaml' meta = Config(cfg_file=meta_file) base_model = meta['PARAMS']['base_model_revision'] tuner_type = meta['PARAMS']['tuner_name']
- +

SCEPTER Studio is a customized generation and editing toolkit built on the open-source base models and proprietary fine-tuning editing algorithms, offering a range of tools and plugins centered around generation, fine-tuning, editing, and data processing.