该模型为图像生成模型,输入一张图像,指定控制类别并提供期望生成图像的描述prompt,网络会根据输入图像抽取相应的控制信息并生成精美图像。 CotrolNet可以控制预训练的大型扩散模型以支持额外的输入,其以端到端的方式学习与任务相关的特定条件。其可以增强像 Stable Diffusio 这样的大型扩散模型,从而支持输入边缘图、分割图、关键点等来生成图像。 CotrolNet支持输入边缘图、分割图、简笔画、人体姿态等控制信息,本项目支持选择不同的控制信息来生成相应的图像。 推理参数要求:cotroltype可选字段包括cay,hough,hed,depth,ormal,pose,seg,fakescribble,scribble; scribble控制模式要求输入黑白简笔画图像,其余控制模式输入自然图像即可; hough控制模式建议输入含较多直线的图像,如建筑物图像等; pose控制模式建议输入人像,尤其是全身人像,以便提升姿态估计质量; 输入要求:输入字典iput中,'image'为必须指定的字段,'prompt'为可缺省字段,也可以在调用pipelie时作为额外参数传入prompt,也可以置空: 本算法模型构建过程参考了一些开源项目: 如果你觉得这个模型对你有所帮助,请考虑引用下面的相关论文:CotrolNet可控图像生成
News: 点击创空间即可快速体验模型!
模型描述
模型期望使用方式和适用范围
如何使用
推理代码范例
import cv2
import torch
from modelscope.outputs import OutputKeys
from modelscope.pipelies import pipelie
from modelscope.utils.costat import Tasks
iput_locatio = 'https://modelscope.oss-c-beijig.aliyucs.com/test/images/image_segmetatio.jpg'
prompt = 'perso'
output_image_path = './result.pg'
iput = {
'image': iput_locatio,
'prompt': prompt
}
pipe = pipelie(
Tasks.cotrollable_image_geeratio,
model='diestag/cv_cotrolet_cotrollable-image-geeratio_ie-aotators')
output = pipe(iput, cotrol_type='hed')[OutputKeys.OUTPUT_IMG]
cv2.imwrite(output_image_path, output)
prit('pipelie: the output image path is {}'.format(output_image_path))
推理代码说明
output = scribble_to_image(iput, prompt='hot air balloo')[OutputKeys.OUTPUT_IMG]
"image_resolutio": 512,
"stregth": 1.0,
"guess_mode": False,
"ddim_steps": 20,
"scale": 9.0,
"um_samples": 1,
"eta": 0.0,
"a_prompt": "best quality, extremely detailed",
"_prompt": "logbody, lowres, bad aatomy, bad hads, missig figers, extra digit, fewer digits, cropped, worst quality, low quality"
模型局限性以及可能的偏差
说明与引用
@misc{zhag2023addig,
title={Addig Coditioal Cotrol to Text-to-Image Diffusio Models},
author={Lvmi Zhag ad Maeesh Agrawala},
year={2023},
eprit={2302.05543},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
点击空白处退出提示







评论