---
title: cos
canonical_url: "https://www.modelscope.cn/models/wosoxo/cos"
md_url: "https://www.modelscope.cn/models/wosoxo/cos.md"
repository: wosoxo/cos
chinese_name: cos
last_updated: 2026-08-19
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
parameters: 462.4M
tensor_type:
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - pytorch
supports_inference: txt2img
downloads: 19
stars: 0
---

# cos

> cos - wosoxo 在 ModelScope 开源的模型。该模型是在开源代码基座模型【基座名称】上，使用自建代码数据集二次微调后的垂直编程大模型，支持 Python、Java、Go 等主流编程语言的代码生成、片段补全、错误分析与代码解释。本仓库仅用于个人部署测试，不开放下载与商用分发，模型使用权遵循原基座模型开源协议。

wosoxo/cos 是 ModelScope 魔搭社区上的 462.4M 参数text-to-image-synthesis模型，并支持在线推理（txt2img）。

- **Repository**: wosoxo/cos
- **Tasks**: text-to-image-synthesis
- **Parameters**: 462.4M
- **Online inference**: txt2img
- **Downloads**: 19
- **Stars**: 0
- **Last updated**: 2026-08-19

Source: https://www.modelscope.cn/models/wosoxo/cos

---

# sos

## 模型介绍

本模型依托魔搭社区（ModelScope）AIGC专区[模型训练](https://modelscope.cn/aigc/modelTraining)环境与算力完成训练。

* 模型类型：LoRA
* 基础模型：[Lightricks/LTX-2.3](https://modelscope.cn/models/Lightricks/LTX-2.3)
* 训练代码：[DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio)
* 训练数据量：2
* 总训练步数：3000
* 开源协议：Apache-2.0

## 推理代码

安装 [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio)：

```bash
pip install diffsynth
```

开始推理：

```python
import torch
from diffsynth.pipelines.ltx2_audio_video import LTX2AudioVideoPipeline, ModelConfig
from diffsynth.utils.data.media_io_ltx2 import write_video_audio_ltx2

vram_config = {
    "offload_dtype": torch.float8_e5m2,
    "offload_device": "cpu",
    "onload_dtype": torch.float8_e5m2,
    "onload_device": "cpu",
    "preparing_dtype": torch.float8_e5m2,
    "preparing_device": "cuda",
    "computation_dtype": torch.bfloat16,
    "computation_device": "cuda",
}
pipe = LTX2AudioVideoPipeline.from_pretrained(
    torch_dtype=torch.bfloat16,
    device="cuda",
    model_configs=[
        ModelConfig(model_id="google/gemma-3-12b-it-qat-q4_0-unquantized", origin_file_pattern="model-*.safetensors", **vram_config),
        ModelConfig(model_id="Lightricks/LTX-2.3", origin_file_pattern="ltx-2.3-22b-dev.safetensors", **vram_config),
        ModelConfig(model_id="Lightricks/LTX-2.3", origin_file_pattern="ltx-2.3-spatial-upscaler-x2-1.0.safetensors", **vram_config),
    ],
    tokenizer_config=ModelConfig(model_id="google/gemma-3-12b-it-qat-q4_0-unquantized"),
    stage2_lora_config=ModelConfig(model_id="Lightricks/LTX-2.3", origin_file_pattern="ltx-2.3-22b-distilled-lora-384.safetensors"),
    vram_limit=torch.cuda.mem_get_info("cuda")[1] / (1024 ** 3) - 0.5,
)
pipe.load_lora(pipe.dit, ModelConfig(model_id="wosoxo/cos", origin_file_pattern="cos_c2-st3000.safetensors"))
prompt = "a cat"
video, audio = pipe(
    prompt=prompt,
    negative_prompt=pipe.default_negative_prompt["LTX-2.3"],
    height=1536, width=1024, num_frames=121,
    tiled=True, use_two_stage_pipeline=True,
)
write_video_audio_ltx2(video, audio, 'video.mp4', fps=24)
```
