直呼太强了!国产模型遇上国产算力

#模力方舟 #MoArk #GPU #租显卡 #模力方舟GPU体验官 #模力方舟GPU赛博名片 #国产GPU

随着大模型应用进入加速落地阶段,如何以更低门槛、更高效率获得稳定算力,成为团队与开发者的共识需求。

模力方舟近期上线的「算力市场」,提供即开即用、灵活计费的国产 GPU 实例,现已全面支持 沐曦 C500、燧原 S60 等多型号算力资源,最高 64GB 显存,按分钟计费,随用随开。

原 ai.gitee.com 启用了新的域名 moark.com/

快速体验一把国产算力的澎湃动力吧!

开机

以沐曦 曦云C500型号 为例,租用一张64GB,镜像选择 PyTorch / 2.6.0 / Python 3.10 / maca 3.2.1.3

编写代码

点击选择Jupyterlab进入到容器当中并新建一个.ipynb文件

需要先行安装一下diffusers库

python 复制代码
!pip install diffusers

之后运行下列代码,自行修改生图提示词

python 复制代码
from diffusers import DiffusionPipeline
import torch

#如果是沐曦的曦云C500,可使用内置的模型路径 /mnt/moark-models/Qwen-Image
model_name = "/mnt/moark-models/Qwen-Image"

# Load the pipeline
if torch.cuda.is_available():
    torch_dtype = torch.bfloat16
    device = "cuda"
else:
    torch_dtype = torch.float32
    device = "cpu"

pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
pipe = pipe.to(device)


# Generate image
prompt = '''生图提示词在这里写'''

negative_prompt = " " 


aspect_ratios = {
    "1:1": (1328, 1328),
    "16:9": (1664, 928),
    "9:16": (928, 1664),
    "4:3": (1472, 1140),
    "3:4": (1140, 1472),
    "3:2": (1584, 1056),
    "2:3": (1056, 1584),
}

width, height = aspect_ratios["9:16"]

image = pipe(
    prompt=prompt,
    negative_prompt=negative_prompt,
    width=width,
    height=height,
    num_inference_steps=50,
    true_cfg_scale=4.0,
    generator=torch.Generator(device="cuda").manual_seed(42)
).images[0]

查看结果

之后将得到

内置模型

这个容器当中已经内置了很多模型,目录在/mnt/moark-models/Qwen-Image

命令行工具

在运行的过程中,可以使用mx-smi命令查看显存的占用情况

从开机到得到第一张图,大概就是一分钟左右两分钟的样子,真的很快,在科研、原型验证阶段,是非常好的帮手!

相关推荐
特立独行的猫A40 分钟前
用仓颉语言 cj-tauri 框架,五分钟给娃做了个鸿蒙形近字游戏
java·后端·python
码事漫谈3 小时前
我花了一周时间,看AI公司怎么"管"AI,结果越看越后背发凉
后端
爱学习的程序媛6 小时前
Python常用框架梳理
开发语言·后端·python·ai·web·后端框架·python框架
GISer_Jing6 小时前
Agent核心内容
后端·ai·langchain
budingxiaomoli7 小时前
Spring统一功能处理
java·后端·spring
某鹏8 小时前
网关选型:Go、Java、Graal 谁都不能完胜
后端
用户0247836530978 小时前
从屎山到防线:14 行状态迁移表,给任务系统装上防瞎跳闸门
后端
CQU_JIAKE9 小时前
11.13[体系结构】指标,五级流水线,八级流水线,虚实地址思考
后端
panbook11 小时前
从0到1实现一个分布式时序数据库(三):主从复制、故障检测与切换
后端
上线再说11 小时前
图片从 8.2MB 压到 296KB:我把小程序图片链路的账单拆了一遍
后端