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

#模力方舟 #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命令查看显存的占用情况

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

相关推荐
阿正的梦工坊8 小时前
【Rust】02-变量、不可变性与基础类型
开发语言·后端·rust
我叫黑大帅10 小时前
通过php 中的Route:: 的写法了解什么是静态类调用
后端·面试·php
JS菌10 小时前
AI Agent 沙箱双层防护体系:从权限过滤到内核隔离的完整实现
前端·人工智能·后端
IT空门:门主11 小时前
Spring 注入三剑客:@Resource、@Autowired、@RequiredArgsConstructor 到底该用哪个?
java·后端·spring
ServBay11 小时前
云端 AI 蜜月期宣告结束,为什么 2026 年开发者转向本地优先架构
后端·ai编程
IT_陈寒11 小时前
Vite这个坑我帮你踩了,动态导入居然这样才生效
前端·人工智能·后端
Sam_Deep_Thinking11 小时前
Spring Boot 的启动原理是什么?
java·spring boot·后端
南部余额11 小时前
Spring WebClient 从入门到精通
java·后端·spring
摇滚侠12 小时前
Spring 零基础入门到进阶 基于注解管理 Bean 38-43
xml·java·后端·spring·intellij-idea
SamDeepThinking12 小时前
我们当年是如何真实落地BFF的?
java·后端·架构