Image-to-Image
Diffusers
Safetensors
image-decomposition
layered-image-editing
diffusion
flux
lora
transparent-rgba
Instructions to use SynLayers/synlayers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use SynLayers/synlayers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("fill-in-base-model", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("SynLayers/synlayers") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -31,6 +31,43 @@ The full SynLayers system has two stages:
|
|
| 31 |
|
| 32 |
This repository is intended for the SynLayers decomposition pipeline. It is not meant to be loaded as a single generic `DiffusionPipeline(prompt)` model.
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
For more details, please check our paper:
|
| 35 |
[https://arxiv.org/abs/2605.15167](https://arxiv.org/abs/2605.15167)
|
| 36 |
|
|
|
|
| 31 |
|
| 32 |
This repository is intended for the SynLayers decomposition pipeline. It is not meant to be loaded as a single generic `DiffusionPipeline(prompt)` model.
|
| 33 |
|
| 34 |
+
## Stage 2 Inference
|
| 35 |
+
|
| 36 |
+
The standalone Stage 2 entrypoint is:
|
| 37 |
+
|
| 38 |
+
- `infer/infer.py`
|
| 39 |
+
- `infer/infer.yaml`
|
| 40 |
+
|
| 41 |
+
Stage 2 expects images plus a JSONL file containing the whole-image caption and bounding boxes. The easiest way to get those inputs is to run Stage 1 first with [`SynLayers/Bbox-caption-8b`](https://huggingface.co/SynLayers/Bbox-caption-8b), or use the public Space for the full two-stage pipeline.
|
| 42 |
+
|
| 43 |
+
After preparing your inputs, update these fields in `infer/infer.yaml`:
|
| 44 |
+
|
| 45 |
+
```yaml
|
| 46 |
+
data_dir: "path/to/your/work_dir"
|
| 47 |
+
image_dir: "path/to/your/images"
|
| 48 |
+
test_jsonl: "path/to/caption_bbox_infer.jsonl"
|
| 49 |
+
save_dir: "path/to/save/results"
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
Then run:
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
python infer/infer.py \
|
| 56 |
+
--config_path infer/infer.yaml
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
The default checkpoint paths in `infer/infer.yaml` are repo-relative and point to the assets in this repository:
|
| 60 |
+
|
| 61 |
+
```yaml
|
| 62 |
+
pretrained_model_name_or_path: "SynLayers_checkpoints/FLUX.1-dev"
|
| 63 |
+
pretrained_adapter_path: "SynLayers_checkpoints/FLUX.1-dev-Controlnet-Inpainting-Alpha"
|
| 64 |
+
lora_ckpt: "SynLayers_ckpt/step_120000/transformer"
|
| 65 |
+
layer_ckpt: "SynLayers_ckpt/step_120000"
|
| 66 |
+
adapter_lora_dir: "SynLayers_ckpt/step_120000/adapter"
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
For most users, the public Space is the recommended interface because it runs both Stage 1 and Stage 2 in one workflow.
|
| 70 |
+
|
| 71 |
For more details, please check our paper:
|
| 72 |
[https://arxiv.org/abs/2605.15167](https://arxiv.org/abs/2605.15167)
|
| 73 |
|