This is a LoRA fine-tune of the THUDM/CogView4-6B model.

Code: https://github.com/a-r-r-o-w/finetrainers

Inference code:

import torch
from diffusers import CogView4Pipeline
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"


pipe = CogView4Pipeline.from_pretrained(
    "THUDM/CogView4-6B", torch_dtype=torch.bfloat16
).to("cuda")
pipe.load_lora_weights("oyxy2019/CogView4-6B-zhmx-v0", adapter_name="cogview4-lora")
pipe.set_adapters(["cogview4-lora"], [0.9])

# Open it for reduce GPU memory usage
# pipe.enable_model_cpu_offload()
# pipe.vae.enable_slicing()
# pipe.vae.enable_tiling()

# 推理
prompt = "这是一幅红色的剪纸图案,具有中国传统民间艺术风格。图案中央是一个可爱的娃娃形象,周围环绕着各种吉祥元素,如莲花、鱼和凤凰等。这些元素通常象征着幸福、繁荣和好运。整体设计对称且富有装饰性,体现了剪纸艺术的独特美感。"
image = pipe(prompt).images[0]
image.save("output_1.png")
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support