Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
qiujiawei 57ae27fa0b | 11 months ago | |
---|---|---|
configs | 11 months ago | |
demo | 1 year ago | |
doc | 11 months ago | |
ldm | 11 months ago | |
mindpet | 11 months ago | |
scripts | 11 months ago | |
README.md | 11 months ago | |
__init__.py | 1 year ago | |
inference.py | 11 months ago | |
openi.py | 11 months ago | |
prompt.txt | 11 months ago | |
requirements.txt | 1 year ago | |
run_train.py | 11 months ago | |
train.py | 11 months ago | |
txt2img.py | 11 months ago |
Stablediffusionv2模型由Stability-AI团队研发,由华为昇腾部门适配Mindspore+Ascend环境实现。
LoRA算法是一种针对超大语言模型的轻量化微调算法,通过使用两个低维度的矩阵乘积近似原始模型中线性结构的权重矩阵,在下游任务微调时,冻结原始网络参数,仅更新LoRA矩阵,来减少微调参数数量。
目前分别在 U-Net的交叉注意力层q、k、v、output四个模块上,加入了LoRA模块,lora_rank采用128维,然后在自建的数据集上进行微调。
昇腾软硬件解决方案(驱动+固件+CANN)
前往昇腾社区,按照说明下载安装。
AI框架 - MindSpore == 1.9
前往MindSpore官网,按照说明下载安装。
如需更多帮助,可以参考以下资料
第三方依赖
pip install -r requirements.txt
下载stablediffusionv2预训练参数 stablediffusionv2_512.ckpt 至 stablediffusionv2/models/ 目录.
要进行文图生成,可以运行txt2img.py 或者直接使用默认参数运行 infer.sh.
python txt2img.py --prompt [input text] --ckpt_path [ckpt_path] --ckpt_name [ckpt_name] \
--H [image_height] --W [image_width] --output_path [image save folder] \
--n_samples [number of images to generate]
或者
bash scripts/infer.sh
更高的分辨率需要更大的显存. 对于 Ascend 910 芯片, 我们可以同时生成8张512x512的图片。
mind_stablediffusionv2
Python Markdown Shell Text
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》