模型地址 https://www.modelscope.cn/models/langboat/Guohua-Diffusion/summary
新建一个main.py
from modelscope.utils.constant import Tasks
from modelscope.pipelines import pipeline
import cv2
pipe = pipeline(task=Tasks.text_to_image_synthesis,
model='langboat/Guohua-Diffusion',
model_revision='v1.0')
prompt = 'The Godfather poster in guohua style'
output = pipe({'text': prompt})
cv2.imwrite('result.png', output['output_imgs'][0])
安装依赖
modelscope
torch
transformers
diffusers