温州市网站建设_网站建设公司_动画效果_seo优化
2025/12/22 12:32:09 网站建设 项目流程

简介

我们很高兴推出Qwen-Image-Layered模型,该模型能够将图像分解为多个RGBA图层。这种分层表示解锁了内在可编辑性:每个图层可以独立操作而不影响其他内容。同时,这种分层表示天然支持高保真基础操作——例如调整大小、重新定位和重新着色。通过将语义或结构组件物理隔离到不同图层中,我们的方法实现了高保真且一致的编辑。

快速开始

  1. 确保您的transformers版本≥4.51.3(支持Qwen2.5-VL)
  2. 安装最新版diffusers
pip install git+https://github.com/huggingface/diffusers pip install python-pptx
fromdiffusersimportQwenImageLayeredPipelineimporttorchfromPILimportImage pipeline=QwenImageLayeredPipeline.from_pretrained("Qwen/Qwen-Image-Layered")pipeline=pipeline.to("cuda",torch.bfloat16)pipeline.set_progress_bar_config(disable=None)image=Image.open("asserts/test_images/1.png").convert("RGBA")inputs={"image":image,"generator":torch.Generator(device='cuda').manual_seed(777),"true_cfg_scale":4.0,"negative_prompt":" ","num_inference_steps":50,"num_images_per_prompt":1,"layers":4,"resolution":640,# Using different bucket (640, 1024) to determine the resolution. For this version, 640 is recommended"cfg_normalize":True,# Whether enable cfg normalization."use_en_prompt":True,# Automatic caption language if user does not provide caption}withtorch.inference_mode():output=pipeline(**inputs)output_image=output.images[0]fori,imageinenumerate(output_image):image.save(f"{i}.png")

案例展示

应用中的分层解构

给定一张图像,Qwen-Image-Layered可将其分解为多个RGBA图层:

分解后,编辑操作仅作用于目标图层,使其在物理层面与其他内容隔离,从而从根本上确保编辑的一致性。

例如,我们可以单独对首层重新着色,同时保持其他所有内容不受影响:

我们也可以将第二层从女孩替换为男孩(目标层使用Qwen-Image-Edit进行编辑):

我们将文本修改为“Qwen-Image”(目标图层使用Qwen-Image-Edit进行编辑):

此外,分层结构天然支持基础操作。例如,我们可以彻底删除不需要的对象。

我们也可以在不失真的情况下调整对象大小:

分层解构后,我们可以在画布上自由移动对象:

灵活可迭代的分层

Qwen-Image-Layered 不局限于固定分层数量。该模型支持可变层数分解,例如根据需求可将图像分解为3层或8层:

此外,分解可以递归应用:任何层级本身都可以进一步分解,从而实现无限分解。

许可协议

Qwen-Image-Layered 采用 Apache 2.0 许可证授权。

引用说明

如果您认为我们的工作对您有所帮助,我们诚挚地建议您引用相关成果。

@misc{yin2025qwenimagelayered, title={Qwen-Image-Layered: Towards Inherent Editability via Layer Decomposition}, author={Shengming Yin, Zekai Zhang, Zecheng Tang, Kaiyuan Gao, Xiao Xu, Kun Yan, Jiahao Li, Yilei Chen, Yuxiang Chen, Heung-Yeung Shum, Lionel M. Ni, Jingren Zhou, Junyang Lin, Chenfei Wu}, year={2025}, eprint={2512.15603}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2512.15603}, }

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询