Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ API and command-line option may change frequently.***
- [Ming-Image Design](./docs/models/ming_image.md)
- [PixArt](./docs/models/pixart.md)
- [Iris-3B](./docs/models/iris.md)
- [RD Flow 64](./docs/models/rd_flow_64.md)
- [Image Edit Models](./docs/guides/edit.md)
- [FLUX.1-Kontext-dev](./docs/models/kontext.md)
- [Qwen Image Edit series](./docs/models/qwen_image_edit.md)
Expand Down
Binary file added assets/rd_flow_64/dgl_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rd_flow_64/dgl_palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rd_flow_64/dgl_tokens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rd_flow_64/lighthouse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rd_flow_64/locked_palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rd_flow_64/locked_palette_strip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rd_flow_64/max_colours_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rd_flow_64/opaque.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/rd_flow_64/sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/dgl-builtins.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Optional parameters are marked with `?`. Default values follow `=`. See [DGL syn
| `pulid::apply` | `condition: dict`, `pulid: pulid`, `embedding: tensor`, `strength?: number = 1`, `start_sigma?: number`, `end_sigma?: number` | same type as `condition`<br>`pulid: pulid_bindings` |
| `pulid::load` (resource) | `path: string`, `family?: string = "auto"`, `wtype?: string = "auto"`, `conv_scale?: number = 0`, `linear_scale?: number = 0`, `attn_scale?: number = 0`, `backend?: string = ""`, `params_backend?: string = ""`, `split_mode?: string = ""`, `model_args?: string = ""`, `tensor_type_rules?: string = ""`, `flash_attn_mode?: string = "auto"`, `conv_direct_mode?: string = "auto"`, `sage_attn?: bool = false`, `linear_type?: string = "auto"` | `pulid` |
| `pulid::load_embedding` | `path: string` | `tensor` |
| `rd_flow::sample` | `start: tensor`, `predict: predictor`, `steps?: int = 16`, `guidance?: number = 4.0`, `interval_lo?: number = 0.0`, `interval_hi?: number = 0.9`, `shift?: number = 3.0`, `palette_at?: number = 0.6`, `pointer_from?: number = 0.35`, `commit_from?: number = 0.55`, `commit_thresh?: number = 0.9`, `max_colours?: int = 64`, `merge?: number = 0.05`, `background?: string = "transparent"`, `source?: int = 6`, `palette?: string = ""` | `dict`<br>`image: tensor`<br>`palette: tensor`<br>`tokens: tensor` |
| `regions::crop` | `image: tensor`, `regions: dict` | `list<tensor>` |
| `regions::from_boxes` | `width: int`, `height: int`, `boxes: any` | `dict`<br>`boxes: tensor`<br>`height: int`<br>`width: int` |
| `regions::paste` | `background: tensor`, `foregrounds: list<tensor>`, `regions: dict` | `tensor` |
Expand Down Expand Up @@ -213,3 +214,4 @@ Pass the ID as the component loader's `family` argument. The default is `"auto"`
| `minimax_h3_image` | MiniMax-H3-Image |
| `relayvsr` | RelayVSR |
| `seedvr2` | SeedVR2 |
| `rd_flow_64` | RD Flow 64 |
1 change: 1 addition & 0 deletions docs/dgl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ and [NumPy tensor files](../dgl.md#tensor-files).
| [Qwen Image](../models/qwen_image.md) | [Text to image](qwen_image/qwen-image-txt2img.dgl) |
| [Qwen Image 2.1](../models/qwen_image_2.1.md) | [Text to image](qwen_image_2.1/qwen-image-2-1-txt2img.dgl) · [Image editing](qwen_image_2.1/qwen-image-2-1-edit.dgl) |
| [Qwen Image Edit](../models/qwen_image_edit.md) | [Qwen Image Edit](qwen_image_edit/qwen-image-edit.dgl) · [Qwen Image Edit 2509](qwen_image_edit/qwen-image-edit-2509.dgl) · [Qwen Image Edit 2511](qwen_image_edit/qwen-image-edit-2511.dgl) |
| [RD Flow 64](../models/rd_flow_64.md) | [Text to image](rd_flow_64/rd-flow-64-txt2img.dgl) |
| [Stable Diffusion – generation](../models/sd.md) | [SD 1.4](sd/sd1-4-txt2img.dgl) · [SD 1.5](sd/sd1-5-txt2img.dgl) · [SDXL](sd/sdxl-txt2img.dgl) · [NitroFusion](sd/nitrosd-realism-nitrofusion.dgl) |
| [Stable Diffusion – image conditioning](../models/sd.md) | [SD 1.4 image to image](sd/sd1-4-img2img.dgl) · [SD 1.5 ControlNet](sd/sd1-5-controlnet.dgl) · [SD 1.5 inpainting](sd/sd1-5-inpainting.dgl) |
| [Stable Diffusion 3](../models/sd3.md) | [SD 3.5 Large text to image](sd3/sd3-5-large-txt2img.dgl) |
Expand Down
43 changes: 43 additions & 0 deletions docs/dgl/rd_flow_64/rd-flow-64-txt2img.dgl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# version: 0.0.0
# docs/models/rd_flow_64.md — Text-to-image

var {
model_path = "../models/rd-flow-64/rd-flow-64.safetensors"
text_path = "../models/rd-flow-64/text_encoder_model.safetensors"
tokenizer_path = "../models/rd-flow-64/text_encoder/tokenizer.json"

output_path = "rd_flow_64.png"
palette_path = "rd_flow_64_palette.npy"
tokens_path = "rd_flow_64_tokens.npy"

prompt = "a small red rocket with a round blue window, one tall pine, gradient dusk sky"

seed = 1
rng_type = "cpu"
width = 64
height = 64

steps = 8
cfg_scale = 4.0
}

fn main() {
model = load_dit(model_path, family = "rd_flow_64")
text = load_text_encoder(text_path, family = "rd_flow_64", tokenizer = tokenizer_path)

condition = encode_prompt(text, prompt, width = width, height = height)
# The noise sprite is [4, width, height, 1]: ggml fills the fastest axis first,
# so a fixed seed hands the model the same noise as the reference's
# randn((64, 64, 4)), which is channel-last.
noise = tensor::randn_like(tensor::zeros([4, width, height, 1]), rng = make_rng(rng_type, seed = seed))
# rd_flow::sample owns the whole drawing: its shifted schedule, guidance (it
# drops the prompt rows, because the model has no negative prompt), the palette
# it extracts partway through, and the per-pixel palette token it commits.
drawing = rd_flow::sample(noise, predict = predictor(model, condition), steps = steps, guidance = cfg_scale)
image::save(output_path, image::to_u8(drawing.image))
# The palette and the pixel map are the lossless form of the sprite: re-decode
# them for another size, or save the swatches.
tensor::save(palette_path, drawing.palette)
tensor::save(tokens_path, drawing.tokens)
return {image = drawing.image, palette = drawing.palette, tokens = drawing.tokens}
}
1 change: 1 addition & 0 deletions docs/models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ variant; a VAE or TAE selection must match that model.
- [PixArt](pixart.md)
- [Qwen Image](qwen_image.md)
- [Qwen Image 2.1](qwen_image_2.1.md)
- [RD Flow 64](rd_flow_64.md)
- [SeFi-Image](sefi_image.md)
- [SenseNova U1.5](sensenova_u1.md)
- [Stable Diffusion 1.x, 2.x, and SDXL, including Turbo variants](sd.md)
Expand Down
Loading