Instructions to use BiliSakura/DiffusionSat-Single-512 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BiliSakura/DiffusionSat-Single-512 with Diffusers:
pip install -U diffusers transformers accelerate
from diffusers import ControlNetModel, StableDiffusionControlNetPipeline controlnet = ControlNetModel.from_pretrained("BiliSakura/DiffusionSat-Single-512") pipe = StableDiffusionControlNetPipeline.from_pretrained( "fill-in-base-model", controlnet=controlnet ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Add files using upload-large-folder tool
Browse files- .gitattributes +0 -14
- README.md +5 -48
- demo_images/readme_text2img.jpeg +0 -0
- scheduler/scheduler_config.json +1 -1
.gitattributes
CHANGED
|
@@ -33,17 +33,3 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
-
demo_images/output.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
-
demo_images/compare_current_ddim_50.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 38 |
-
demo_images/scheduler_ablation/euler.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 39 |
-
demo_images/output_custom_metadata.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 40 |
-
demo_images/full_ddim_zeros.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 41 |
-
demo_images/full_ddim_none.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 42 |
-
demo_images/full_ddim_custom.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 43 |
-
demo_images/full_pndm_custom.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 44 |
-
demo_images/full_euler_custom.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 45 |
-
demo_images/ablation/fp16_metadata_none.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 46 |
-
demo_images/ablation/fp16_metadata_zeros.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 47 |
-
demo_images/ablation/fp32_metadata_none.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 48 |
-
demo_images/scheduler_ablation/ddim.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 49 |
-
demo_images/ablation/fp32_metadata_zeros.jpeg filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -10,20 +10,16 @@ tags:
|
|
| 10 |
widget:
|
| 11 |
- prompt: satellite image of farmland with roads
|
| 12 |
output:
|
| 13 |
-
url: demo_images/
|
| 14 |
---
|
| 15 |
|
| 16 |
-
> [!
|
|
|
|
| 17 |
|
| 18 |
# DiffusionSat Custom Pipelines
|
| 19 |
|
| 20 |
Custom community pipelines for loading DiffusionSat checkpoints directly with `diffusers.DiffusionPipeline.from_pretrained()`.
|
| 21 |
|
| 22 |
-
> [!WARNING]
|
| 23 |
-
> **Known checkpoint issue (current release):** generation can degrade to near-total noise for many prompts/settings.
|
| 24 |
-
> This appears to be a checkpoint compatibility/conversion issue, not expected model behavior.
|
| 25 |
-
> We are working on a fix and will update this model card when a corrected checkpoint is available.
|
| 26 |
-
|
| 27 |
See [Diffusers Community Pipeline Documentation](https://huggingface.co/docs/diffusers/using-diffusers/custom_pipeline_overview).
|
| 28 |
|
| 29 |
## Model Index
|
|
@@ -68,47 +64,8 @@ pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
|
| 68 |
image = pipe(
|
| 69 |
"satellite image of farmland",
|
| 70 |
metadata=None, # Optional
|
|
|
|
|
|
|
| 71 |
num_inference_steps=50,
|
| 72 |
).images[0]
|
| 73 |
```
|
| 74 |
-
|
| 75 |
-
### 2. ControlNet Pipeline
|
| 76 |
-
|
| 77 |
-
Use `pipeline_diffusionsat_controlnet.py` for ControlNet generation.
|
| 78 |
-
|
| 79 |
-
```python
|
| 80 |
-
import torch
|
| 81 |
-
from diffusers import DiffusionPipeline, ControlNetModel
|
| 82 |
-
from diffusers.utils import load_image
|
| 83 |
-
|
| 84 |
-
# 1. Load ControlNet
|
| 85 |
-
controlnet = ControlNetModel.from_pretrained(
|
| 86 |
-
"path/to/ckpt/diffusionsat/controlnet",
|
| 87 |
-
torch_dtype=torch.float16
|
| 88 |
-
)
|
| 89 |
-
|
| 90 |
-
# 2. Load Pipeline with ControlNet
|
| 91 |
-
pipe = DiffusionPipeline.from_pretrained(
|
| 92 |
-
"path/to/ckpt/diffusionsat",
|
| 93 |
-
controlnet=controlnet,
|
| 94 |
-
custom_pipeline="./pipeline_diffusionsat_controlnet.py", # Path to this file
|
| 95 |
-
torch_dtype=torch.float16,
|
| 96 |
-
trust_remote_code=True,
|
| 97 |
-
)
|
| 98 |
-
pipe = pipe.to("cuda")
|
| 99 |
-
|
| 100 |
-
# 3. Prepare Control Image
|
| 101 |
-
control_image = load_image("path/to/conditioning_image.png")
|
| 102 |
-
|
| 103 |
-
# 4. Generate
|
| 104 |
-
# metadata: Target image metadata (optional)
|
| 105 |
-
# cond_metadata: Conditioning image metadata (optional)
|
| 106 |
-
|
| 107 |
-
image = pipe(
|
| 108 |
-
"satellite image of farmland",
|
| 109 |
-
image=control_image,
|
| 110 |
-
metadata=None,
|
| 111 |
-
cond_metadata=None,
|
| 112 |
-
num_inference_steps=30,
|
| 113 |
-
).images[0]
|
| 114 |
-
```
|
|
|
|
| 10 |
widget:
|
| 11 |
- prompt: satellite image of farmland with roads
|
| 12 |
output:
|
| 13 |
+
url: demo_images/readme_text2img.jpeg
|
| 14 |
---
|
| 15 |
|
| 16 |
+
> [!NOTE]
|
| 17 |
+
> If you encounter pipeline loading failure or unexpected output, please contact bili_sakura@zju.edu.cn.
|
| 18 |
|
| 19 |
# DiffusionSat Custom Pipelines
|
| 20 |
|
| 21 |
Custom community pipelines for loading DiffusionSat checkpoints directly with `diffusers.DiffusionPipeline.from_pretrained()`.
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
See [Diffusers Community Pipeline Documentation](https://huggingface.co/docs/diffusers/using-diffusers/custom_pipeline_overview).
|
| 24 |
|
| 25 |
## Model Index
|
|
|
|
| 64 |
image = pipe(
|
| 65 |
"satellite image of farmland",
|
| 66 |
metadata=None, # Optional
|
| 67 |
+
height=512,
|
| 68 |
+
width=512,
|
| 69 |
num_inference_steps=50,
|
| 70 |
).images[0]
|
| 71 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
demo_images/readme_text2img.jpeg
ADDED
|
scheduler/scheduler_config.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
"beta_start": 0.00085,
|
| 7 |
"clip_sample": false,
|
| 8 |
"num_train_timesteps": 1000,
|
| 9 |
-
"prediction_type": "
|
| 10 |
"set_alpha_to_one": false,
|
| 11 |
"skip_prk_steps": true,
|
| 12 |
"steps_offset": 1,
|
|
|
|
| 6 |
"beta_start": 0.00085,
|
| 7 |
"clip_sample": false,
|
| 8 |
"num_train_timesteps": 1000,
|
| 9 |
+
"prediction_type": "v_prediction",
|
| 10 |
"set_alpha_to_one": false,
|
| 11 |
"skip_prk_steps": true,
|
| 12 |
"steps_offset": 1,
|