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