---
title: GenEarth
canonical_url: "https://www.modelscope.cn/studios/KyanChen/GenEarth"
md_url: "https://www.modelscope.cn/studios/KyanChen/GenEarth.md"
repository: KyanChen/GenEarth
chinese_name: GenEarth
last_updated: 2026-08-30
sdk_type: gradio
sdk_version: 6.17.3
downloads: 0
stars: 1
---

# GenEarth

> GenEarth - KyanChen 在 ModelScope 创建的在线 Demo。GenEarth is an open-source research series centered on Text2Earth, a 1.3B-parameter diffusion foundation model for text-driven, resolution-controllable remote-sensing image generation, supported by the global…

KyanChen/GenEarth 是 ModelScope 魔搭社区上的在线可交互 Demo（创空间），基于 gradio 6.17.3 构建。

- **Repository**: KyanChen/GenEarth
- **SDK**: gradio
- **SDK version**: 6.17.3
- **Downloads**: 0
- **Stars**: 1
- **Last updated**: 2026-08-30

Source: https://www.modelscope.cn/studios/KyanChen/GenEarth

---

<div align="center">
  <img src="images/logo.png" alt="GenEarth logo" width="260">
  <h1>GenEarth</h1>
  <p><strong>简体中文</strong> | <a href="README_EN.md">English</a></p>
  <p><strong>生成地球，从像素到世界</strong></p>
  <p>面向地球观测的开放生成式基础模型、数据与交互工具</p>
  <p>
    <a href="https://modelscope.cn/studios/KyanChen/GenEarth">在线体验 / Live demo</a> ·
    <a href="https://chen-yang-liu.github.io/Text2Earth/">项目主页</a> ·
    <a href="https://github.com/Chen-Yang-Liu/Text2Earth">Text2Earth GitHub</a> ·
    <a href="https://arxiv.org/abs/2501.00895">论文</a>
  </p>
</div>

![GenEarth research family](images/genearth_family.png)

## 项目简介

**GenEarth** 是以 **Text2Earth** 为核心的开放生成式地球观测研究系列。项目从全球尺度遥感图像—文本数据出发，探索可控二维影像生成、无界场景扩展、多模态地球观测生成，以及世界尺度三维场景生成。

本仓库提供一套可直接运行的 Gradio 应用，将研究介绍与模型交互整合在同一界面中。当前已经接入 Text2Earth 文生遥感图像和 Text2Earth-inpainting 局部重绘；MetaEarth、MetaEarth-MM、MetaEarth3D 等能力目前作为研究成果展示与后续接入入口。

## 当前能力

| 模块 | 能力 | 当前状态 |
| --- | --- | --- |
| 项目首页 | 展示 GenEarth 研究版图、Git-10M、Text2Earth 及扩展工作 | 可用 |
| 文字造景 | 根据英文文本生成遥感影像 | CUDA 真实推理 / CPU 演示预览 |
| 分辨率控制 | 通过 Google Map Level 控制 `1–64 m/px` 空间分辨率 | 可用 |
| 批量生成 | 单次生成 `1–5` 张图像，并记录 Seed 与耗时 | 可用 |
| 局部重绘 | 使用文本修改影像指定区域 | CUDA 真实推理 / CPU 演示预览 |
| 蒙版工具 | 上传黑白蒙版，或通过矩形、圆形参数快速创建蒙版 | 可用 |
| 更多能力 | MetaEarth、MetaEarth-MM、MetaEarth3D、超分辨率等入口 | 展示 / 预留 |

应用支持 `256 × 256` 与 `512 × 512` 输出、推理步数与引导强度调节、固定随机种子、示例加载、蒙版实时预览和运行日志。

> [!IMPORTANT]
> Text2Earth 真实推理需要 CUDA GPU。未检测到 CUDA 时，应用会自动进入带水印的程序化演示模式，用于预览界面和验证交互流程；演示结果不是模型输出。

## 快速开始

### 环境要求

- Python `3.10+`，推荐 Python `3.12`
- CUDA GPU：运行 Text2Earth 真实推理时必需
- 可访问 ModelScope 或 Hugging Face：首次使用时需要下载模型权重

### 方式一：使用 uv

仓库提供了自动创建 Python 3.12 虚拟环境并安装依赖的脚本：

```bash
chmod +x create_uv_env.sh
./create_uv_env.sh
source .venv/bin/activate
python app.py
```

如果本机尚未安装 uv，脚本会通过官方安装脚本自动安装，因此需要 `curl` 和网络连接。

### 方式二：使用 venv + pip

```bash
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
python app.py
```

启动后访问 [http://localhost:7860](http://localhost:7860)。应用默认监听 `0.0.0.0:7860`。

## 使用说明

### 文字造景

1. 在「文字造景」中输入英文场景描述。模型以英文提示词训练，英文通常更稳定。
2. 选择空间分辨率等级、输出尺寸和生成数量。
3. 可在「高级参数」中调整推理步数、文本引导强度与随机种子。
4. CUDA 环境会默认勾选「Text2Earth 真实推理」；点击生成即可查看结果与运行日志。

示例提示词：

```text
Many rectangular-shaped green and tan mixed farmlands of different sizes
```

### 局部重绘

1. 上传原始遥感影像，或加载内置示例。
2. 选择矩形选区、圆形选区或上传黑白蒙版。
3. 在蒙版预览中确认橙色区域；上传蒙版时，**白色表示重绘，黑色表示保留**。
4. 用英文描述希望在选区中生成的内容，然后设置参数并开始重绘。

## 空间分辨率条件

Text2Earth 将 Google Map Level 编码到提示词中：

```text
Resolution = 2^(17 - Level),  Level ∈ [11, 17]
model_prompt = "{Level}_GOOGLE_LEVEL_{content_prompt}"
```

本应用中的等级与空间分辨率对应如下：

| Level | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| 分辨率（m/px） | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

例如，Level 16 与提示词 `Many green trees are in a piece of forest` 会被转换为：

```text
16_GOOGLE_LEVEL_Many green trees are in a piece of forest
```

## 模型加载与配置

模型仅在第一次触发对应的真实推理任务时加载，并在当前进程中缓存。默认优先从 ModelScope 下载；下载失败时可自动回退到 Hugging Face。

| 环境变量 | 默认值 | 说明 |
| --- | --- | --- |
| `GENEARTH_MODEL_SOURCE` | `modelscope` | 模型来源；设为 `huggingface` 可直接使用 Hugging Face |
| `GENEARTH_ALLOW_HF_FALLBACK` | `1` | ModelScope 失败后是否回退 Hugging Face；设为 `0` 可关闭 |
| `GENEARTH_DEMO_MODE` | `0` | 设为 `1` 时，即使存在 CUDA 也强制使用演示预览 |
| `GENEARTH_TEXT2IMAGE_MODEL_PATH` | 空 | 使用本地 Text2Earth 模型目录 |
| `GENEARTH_INPAINTING_MODEL_PATH` | 空 | 使用本地 Text2Earth-inpainting 模型目录 |
| `GRADIO_SERVER_NAME` | `0.0.0.0` | Gradio 监听地址 |
| `GRADIO_SERVER_PORT` | `7860` | 本地监听端口；若存在 `PORT`，优先使用 `PORT` |

使用 Hugging Face 模型源：

```bash
GENEARTH_MODEL_SOURCE=huggingface python app.py
```

使用本地模型：

```bash
export GENEARTH_TEXT2IMAGE_MODEL_PATH=/path/to/Text2Earth
export GENEARTH_INPAINTING_MODEL_PATH=/path/to/Text2Earth-inpainting
python app.py
```

模型通过 Diffusers 自定义 Pipeline 加载，并启用了 `trust_remote_code=True`。使用非官方模型目录前，请先审查其中的自定义代码。

## ModelScope 创空间部署

1. 创建「编程式 / Gradio 6」创空间。
2. 将本仓库内容推送到创空间 Git 仓库。
3. 确认 SDK 版本为 `6.17.3`，入口文件为 `app.py`。
4. 推荐选择带 CUDA 的 GPU 实例，然后上线或重启创空间。

创空间注入 `PORT` 时，应用会自动使用该端口。首次进行真实推理时会下载并缓存相应权重，请为模型缓存预留数 GB 存储空间。

### 中英文入口

同一个创空间同时提供两个页面：

- 中文版：应用根路径 `/`
- English version: 应用路径 `/en`

页首的「中文 / English」按钮可在两个版本之间切换。这一能力由 `app.py` 中的 Gradio 多页面路由提供，ModelScope 创空间仍然只需配置一个入口文件 `app.py`，不需要创建第二个创空间。推送代码后重启创空间即可生效；ModelScope 的页面设置本身不会自动翻译自定义 Gradio 文案。

## 项目结构

```text
GenEarth/
├── README.md              # 中文说明文档
├── README_EN.md           # English documentation
├── app.py                 # Gradio 页面、交互事件与运行配置
├── inference.py           # 模型解析、Pipeline 加载与推理工具
├── ui.py                  # 页面内容、组件样式与项目展示
├── requirements.txt       # Python 运行依赖
├── create_uv_env.sh       # uv 环境创建脚本
└── images/                # 页面素材、论文图示与局部重绘示例
```

## 开放资源与研究版图

| 项目 | 简介 | 资源 |
| --- | --- | --- |
| Git-10M | 1,050 万组全球遥感图像—文本对，包含地理位置与分辨率信息 | [ModelScope](https://modelscope.cn/datasets/lcybuaa1111/Git-10M/) · [Hugging Face](https://huggingface.co/datasets/lcybuaa/Git-10M) |
| Git-RSCLIP | 面向遥感视觉—语言表征的基础模型 | [ModelScope](https://modelscope.cn/models/lcybuaa1111/Git-RSCLIP) · [Hugging Face](https://huggingface.co/lcybuaa/Git-RSCLIP) |
| Text2Earth | 分辨率可控的文本驱动遥感影像生成 | [ModelScope](https://modelscope.cn/models/lcybuaa1111/Text2Earth) · [Hugging Face](https://huggingface.co/lcybuaa/Text2Earth) |
| Text2Earth-inpainting | 文本引导的遥感影像局部重绘 | [ModelScope](https://modelscope.cn/models/lcybuaa1111/Text2Earth-inpainting) · [Hugging Face](https://huggingface.co/lcybuaa/Text2Earth-inpainting) |
| MetaEarth | 全球尺度、分辨率引导的无界遥感影像生成 | [Paper](https://arxiv.org/abs/2405.13570) |
| MetaEarth-MM | 场景中心联合建模的统一多模态遥感影像生成 | [Paper](https://arxiv.org/abs/2605.20090) |
| MetaEarth3D | 空间可扩展的世界尺度三维场景生成 | [Paper](https://arxiv.org/abs/2604.22828) |

![Text2Earth overview](images/overall.png)

## 引用

如果本项目对你的研究有帮助，请引用 Text2Earth：

```bibtex
@ARTICLE{10988859,
  author={Liu, Chenyang and Chen, Keyan and Zhao, Rui and Zou, Zhengxia and Shi, Zhenwei},
  journal={IEEE Geoscience and Remote Sensing Magazine},
  title={Text2Earth: Unlocking Text-driven Remote Sensing Image Generation with a Global-Scale Dataset and a Foundation Model},
  year={2025},
  volume={13},
  number={3},
  pages={238--259},
  doi={10.1109/MGRS.2025.3560455}
}
```

更多论文：

- [MetaEarth: A Generative Foundation Model for Global-Scale Remote Sensing Image Generation](https://arxiv.org/abs/2405.13570)
- [MetaEarth-MM: Unified Multimodal Remote Sensing Image Generation with Scene-centered Joint Modeling](https://arxiv.org/abs/2605.20090)
- [MetaEarth3D: Unlocking World-scale 3D Generation with Spatially Scalable Generative Modeling](https://arxiv.org/abs/2604.22828)

## 说明

本项目用于生成式 GeoAI 的科研展示与模型体验。数据集、模型权重及相关研究成果可能采用各自的许可协议，使用前请同时查阅对应资源页面。
