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 demo/README.md with huggingface_hub
Browse files- demo/README.md +63 -0
demo/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: SynLayers
|
| 3 |
+
emoji: "🧩"
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
python_version: "3.10"
|
| 8 |
+
app_file: app.py
|
| 9 |
+
suggested_hardware: a100-large
|
| 10 |
+
startup_duration_timeout: 2h
|
| 11 |
+
short_description: "GPU Space for SynLayers real-world layer decomposition"
|
| 12 |
+
models:
|
| 13 |
+
- SynLayers/Bbox-caption-8b
|
| 14 |
+
- SynLayers/synlayers
|
| 15 |
+
pinned: false
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# SynLayers Demo
|
| 19 |
+
|
| 20 |
+
This folder now contains a unified real-world inference demo:
|
| 21 |
+
|
| 22 |
+
1. `demo/infer` runs the fixed-prompt VLM caption + bbox detector.
|
| 23 |
+
2. `infer/infer.py` runs SynLayers decomposition with `infer/infer.yaml`.
|
| 24 |
+
3. `demo/real_world_pipeline.py` stitches the two stages together for one uploaded image.
|
| 25 |
+
4. `demo/app.py` provides a Gradio interface that can be used locally or adapted for a Hugging Face Space.
|
| 26 |
+
|
| 27 |
+
## Model Repos
|
| 28 |
+
|
| 29 |
+
The Space now expects two separate model repositories:
|
| 30 |
+
|
| 31 |
+
```text
|
| 32 |
+
SYNLAYERS_BBOX_MODEL_REPO=SynLayers/Bbox-caption-8b
|
| 33 |
+
SYNLAYERS_STAGE2_MODEL_REPO=SynLayers/synlayers
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
This lets the Space:
|
| 37 |
+
|
| 38 |
+
- load the bbox detector from `SynLayers/Bbox-caption-8b`
|
| 39 |
+
- load the Stage 2 SynLayers checkpoints from `SynLayers/synlayers`
|
| 40 |
+
|
| 41 |
+
`SynLayers/Bbox-caption-8b` should only host the Stage 1 bbox-caption model.
|
| 42 |
+
`SynLayers/synlayers` should host the Stage 2 decomposition checkpoints and runtime assets.
|
| 43 |
+
|
| 44 |
+
## Hardware
|
| 45 |
+
|
| 46 |
+
The Space code supports either a dedicated GPU Space or ZeroGPU. Hardware is still chosen in the Hugging Face Space settings.
|
| 47 |
+
|
| 48 |
+
## Local Run
|
| 49 |
+
|
| 50 |
+
From the `SynLayers` root:
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
python demo/app.py
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
Or run the unified CLI directly:
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
python demo/real_world_pipeline.py \
|
| 60 |
+
--image "/path/to/your/image.png"
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
|