Skip to content

Commit 1fa76b5

Browse files
ttchengabvork
andcommitted
Initial commit
Co-authored-by: Mark Boss <hello@markboss.me>
1 parent b07e669 commit 1fa76b5

29 files changed

Lines changed: 3449 additions & 2 deletions

.gitignore

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
IP-Adapter/
2+
models/
3+
sdxl_models/
4+
.gradio/
5+
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# C extensions
12+
*.so
13+
14+
# Distribution / packaging
15+
.Python
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
*.py,cover
55+
.hypothesis/
56+
.pytest_cache/
57+
cover/
58+
59+
# Translations
60+
*.mo
61+
*.pot
62+
63+
# Django stuff:
64+
*.log
65+
local_settings.py
66+
db.sqlite3
67+
db.sqlite3-journal
68+
69+
# Flask stuff:
70+
instance/
71+
.webassets-cache
72+
73+
# Scrapy stuff:
74+
.scrapy
75+
76+
# Sphinx documentation
77+
docs/_build/
78+
79+
# PyBuilder
80+
.pybuilder/
81+
target/
82+
83+
# Jupyter Notebook
84+
.ipynb_checkpoints
85+
86+
# IPython
87+
profile_default/
88+
ipython_config.py
89+
90+
# pyenv
91+
# For a library or package, you might want to ignore these files since the code is
92+
# intended to run in multiple environments; otherwise, check them in:
93+
# .python-version
94+
95+
# pipenv
96+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
98+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
99+
# install all needed dependencies.
100+
#Pipfile.lock
101+
102+
# UV
103+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
104+
# This is especially recommended for binary packages to ensure reproducibility, and is more
105+
# commonly ignored for libraries.
106+
#uv.lock
107+
108+
# poetry
109+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
110+
# This is especially recommended for binary packages to ensure reproducibility, and is more
111+
# commonly ignored for libraries.
112+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
113+
#poetry.lock
114+
115+
# pdm
116+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117+
#pdm.lock
118+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
119+
# in version control.
120+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
121+
.pdm.toml
122+
.pdm-python
123+
.pdm-build/
124+
125+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
126+
__pypackages__/
127+
128+
# Celery stuff
129+
celerybeat-schedule
130+
celerybeat.pid
131+
132+
# SageMath parsed files
133+
*.sage.py
134+
135+
# Environments
136+
.env
137+
.venv
138+
env/
139+
venv/
140+
ENV/
141+
env.bak/
142+
venv.bak/
143+
144+
# Spyder project settings
145+
.spyderproject
146+
.spyproject
147+
148+
# Rope project settings
149+
.ropeproject
150+
151+
# mkdocs documentation
152+
/site
153+
154+
# mypy
155+
.mypy_cache/
156+
.dmypy.json
157+
dmypy.json
158+
159+
# Pyre type checker
160+
.pyre/
161+
162+
# pytype static type analyzer
163+
.pytype/
164+
165+
# Cython debug symbols
166+
cython_debug/
167+
168+
# PyCharm
169+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
170+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
171+
# and can be added to the global gitignore or merged into this file. For a more nuclear
172+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
173+
#.idea/
174+
175+
# Ruff stuff:
176+
.ruff_cache/
177+
178+
# PyPI configuration file
179+
.pypirc

README.md

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,70 @@
1-
# marble
2-
This is the official code base for MARBLE
1+
# MARBLE
2+
3+
<a href='https://marblecontrol.github.io'><img src='https://img.shields.io/badge/Project-Page-green'></a>
4+
<a href='https://marblecontrol.github.io/static/MARBLE.pdf'><img src='https://img.shields.io/badge/Paper-blue'></a>
5+
<a href='https://github.com/Stability-AI/marble'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Gradio%20Demo-Huggingface-orange'></a>
6+
7+
This is the official implementation of MARBLE: Material Recomposition and Blending in CLIP-Space. Given an input image, MARBLE enables edits from material transfer, blending, to parametric control.
8+
9+
![arch](static/teaser.jpg)
10+
11+
12+
## Installation
13+
MARBLE material blocks are built from the code base of [InstantStyle](https://github.com/instantX-research/InstantStyle). Additional functions are added into the `ip_adapter_instantstyle/ip_adapter.py` but please cite their papers accordingly.
14+
15+
The current code base is tested on Python 3.9.7.
16+
17+
We will begin by cloning this repo:
18+
19+
```
20+
git clone https://github.com/Stability-AI/marble.git
21+
```
22+
23+
Then, install the latest the libraries with:
24+
25+
```
26+
cd marble
27+
pip install -r requirements.txt
28+
```
29+
30+
## Usage
31+
32+
After installation and downloading the models, you can use the two demos `try_blend.ipynb` for material blending and `parametric_control.ipynb` for material transfer + multi-attribute parametric control.
33+
34+
We also provide a gradio demo which can be run with `python gradio_demo.py`.
35+
36+
37+
### Using your own materials
38+
For material transfer, you could add your images `input_images/texture/`.
39+
40+
41+
### ComfyUI extension
42+
43+
Custom nodes and an [example workflow](./example_workflow.json) are provided for [ComfyUI](https://github.com/comfyanonymous/ComfyUI).
44+
45+
To install:
46+
47+
* Clone this repo into ```custom_nodes```:
48+
```shell
49+
$ cd ComfyUI/custom_nodes
50+
$ git clone https://github.com/Stability-AI/marble
51+
```
52+
* Install dependencies:
53+
```shell
54+
$ cd marble
55+
$ pip install -r requirements.txt
56+
```
57+
* Restart ComfyUI
58+
59+
60+
## Citation
61+
If you find MARBLE helpful in your research/applications, please cite using this BibTeX:
62+
63+
```bibtex
64+
@article{cheng2024marble,
65+
title={MARBLE: Material Recomposition and Blending in CLIP-Space},
66+
author={Cheng, Ta-Ying and Sharma, Prafull and Boss, Mark and Jampani, Varun},
67+
journal={CVPR},
68+
year={2025}
69+
}
70+
```

0 commit comments

Comments
 (0)