Spaces:
Running
Running
Update
Browse files- .pre-commit-config.yaml +10 -14
- .python-version +1 -0
- .vscode/extensions.json +8 -0
- .vscode/settings.json +5 -14
- README.md +1 -1
- app.py +5 -6
- app_generated_image.py +12 -10
- app_real_image.py +15 -14
- pyproject.toml +65 -0
- requirements.txt +328 -14
- uv.lock +0 -0
.pre-commit-config.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
repos:
|
| 2 |
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 3 |
-
rev:
|
| 4 |
hooks:
|
| 5 |
- id: check-executables-have-shebangs
|
| 6 |
- id: check-json
|
|
@@ -18,13 +18,15 @@ repos:
|
|
| 18 |
hooks:
|
| 19 |
- id: docformatter
|
| 20 |
args: ["--in-place"]
|
| 21 |
-
- repo: https://github.com/
|
| 22 |
-
rev:
|
| 23 |
hooks:
|
| 24 |
-
- id:
|
| 25 |
-
args: ["--
|
|
|
|
|
|
|
| 26 |
- repo: https://github.com/pre-commit/mirrors-mypy
|
| 27 |
-
rev: v1.
|
| 28 |
hooks:
|
| 29 |
- id: mypy
|
| 30 |
args: ["--ignore-missing-imports"]
|
|
@@ -35,14 +37,8 @@ repos:
|
|
| 35 |
"types-PyYAML",
|
| 36 |
"types-pytz",
|
| 37 |
]
|
| 38 |
-
- repo: https://github.com/psf/black
|
| 39 |
-
rev: 24.4.2
|
| 40 |
-
hooks:
|
| 41 |
-
- id: black
|
| 42 |
-
language_version: python3.10
|
| 43 |
-
args: ["--line-length", "119"]
|
| 44 |
- repo: https://github.com/kynan/nbstripout
|
| 45 |
-
rev: 0.
|
| 46 |
hooks:
|
| 47 |
- id: nbstripout
|
| 48 |
args:
|
|
@@ -51,7 +47,7 @@ repos:
|
|
| 51 |
"metadata.interpreter metadata.kernelspec cell.metadata.pycharm",
|
| 52 |
]
|
| 53 |
- repo: https://github.com/nbQA-dev/nbQA
|
| 54 |
-
rev: 1.
|
| 55 |
hooks:
|
| 56 |
- id: nbqa-black
|
| 57 |
- id: nbqa-pyupgrade
|
|
|
|
| 1 |
repos:
|
| 2 |
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 3 |
+
rev: v5.0.0
|
| 4 |
hooks:
|
| 5 |
- id: check-executables-have-shebangs
|
| 6 |
- id: check-json
|
|
|
|
| 18 |
hooks:
|
| 19 |
- id: docformatter
|
| 20 |
args: ["--in-place"]
|
| 21 |
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
| 22 |
+
rev: v0.8.4
|
| 23 |
hooks:
|
| 24 |
+
- id: ruff
|
| 25 |
+
args: ["--fix"]
|
| 26 |
+
- id: ruff-format
|
| 27 |
+
args: ["--line-length", "119"]
|
| 28 |
- repo: https://github.com/pre-commit/mirrors-mypy
|
| 29 |
+
rev: v1.14.0
|
| 30 |
hooks:
|
| 31 |
- id: mypy
|
| 32 |
args: ["--ignore-missing-imports"]
|
|
|
|
| 37 |
"types-PyYAML",
|
| 38 |
"types-pytz",
|
| 39 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
- repo: https://github.com/kynan/nbstripout
|
| 41 |
+
rev: 0.8.1
|
| 42 |
hooks:
|
| 43 |
- id: nbstripout
|
| 44 |
args:
|
|
|
|
| 47 |
"metadata.interpreter metadata.kernelspec cell.metadata.pycharm",
|
| 48 |
]
|
| 49 |
- repo: https://github.com/nbQA-dev/nbQA
|
| 50 |
+
rev: 1.9.1
|
| 51 |
hooks:
|
| 52 |
- id: nbqa-black
|
| 53 |
- id: nbqa-pyupgrade
|
.python-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
3.10
|
.vscode/extensions.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recommendations": [
|
| 3 |
+
"ms-python.python",
|
| 4 |
+
"charliermarsh.ruff",
|
| 5 |
+
"streetsidesoftware.code-spell-checker",
|
| 6 |
+
"tamasfe.even-better-toml"
|
| 7 |
+
]
|
| 8 |
+
}
|
.vscode/settings.json
CHANGED
|
@@ -2,29 +2,20 @@
|
|
| 2 |
"editor.formatOnSave": true,
|
| 3 |
"files.insertFinalNewline": false,
|
| 4 |
"[python]": {
|
| 5 |
-
"editor.defaultFormatter": "
|
| 6 |
"editor.formatOnType": true,
|
| 7 |
"editor.codeActionsOnSave": {
|
|
|
|
| 8 |
"source.organizeImports": "explicit"
|
| 9 |
}
|
| 10 |
},
|
| 11 |
"[jupyter]": {
|
| 12 |
"files.insertFinalNewline": false
|
| 13 |
},
|
| 14 |
-
"black-formatter.args": [
|
| 15 |
-
"--line-length=119"
|
| 16 |
-
],
|
| 17 |
-
"isort.args": ["--profile", "black"],
|
| 18 |
-
"flake8.args": [
|
| 19 |
-
"--max-line-length=119"
|
| 20 |
-
],
|
| 21 |
-
"ruff.lint.args": [
|
| 22 |
-
"--line-length=119"
|
| 23 |
-
],
|
| 24 |
"notebook.output.scrolling": true,
|
| 25 |
"notebook.formatOnCellExecution": true,
|
| 26 |
"notebook.formatOnSave.enabled": true,
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
}
|
|
|
|
| 2 |
"editor.formatOnSave": true,
|
| 3 |
"files.insertFinalNewline": false,
|
| 4 |
"[python]": {
|
| 5 |
+
"editor.defaultFormatter": "charliermarsh.ruff",
|
| 6 |
"editor.formatOnType": true,
|
| 7 |
"editor.codeActionsOnSave": {
|
| 8 |
+
"source.fixAll.ruff": "explicit",
|
| 9 |
"source.organizeImports": "explicit"
|
| 10 |
}
|
| 11 |
},
|
| 12 |
"[jupyter]": {
|
| 13 |
"files.insertFinalNewline": false
|
| 14 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
"notebook.output.scrolling": true,
|
| 16 |
"notebook.formatOnCellExecution": true,
|
| 17 |
"notebook.formatOnSave.enabled": true,
|
| 18 |
+
"notebook.codeActionsOnSave": {
|
| 19 |
+
"source.organizeImports": "explicit"
|
| 20 |
+
}
|
| 21 |
}
|
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🐢
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
suggested_hardware: a10g-small
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: pink
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.9.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
suggested_hardware: a10g-small
|
app.py
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
|
| 3 |
-
from __future__ import annotations
|
| 4 |
-
|
| 5 |
import os
|
| 6 |
import pathlib
|
| 7 |
import shlex
|
|
@@ -23,14 +21,15 @@ if not torch.cuda.is_available():
|
|
| 23 |
if torch.cuda.is_available():
|
| 24 |
weight_dir = pathlib.Path("plug-and-play/models/ldm/stable-diffusion-v1")
|
| 25 |
if not weight_dir.exists():
|
| 26 |
-
subprocess.run(shlex.split("mkdir -p plug-and-play/models/ldm/stable-diffusion-v1/"))
|
| 27 |
-
subprocess.run(
|
| 28 |
shlex.split(
|
| 29 |
"wget https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -O plug-and-play/models/ldm/stable-diffusion-v1/model.ckpt"
|
| 30 |
-
)
|
|
|
|
| 31 |
)
|
| 32 |
|
| 33 |
-
with gr.Blocks(
|
| 34 |
gr.Markdown(DESCRIPTION)
|
| 35 |
with gr.Tabs():
|
| 36 |
with gr.TabItem("Use real image as input"):
|
|
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
|
|
|
|
|
|
|
| 3 |
import os
|
| 4 |
import pathlib
|
| 5 |
import shlex
|
|
|
|
| 21 |
if torch.cuda.is_available():
|
| 22 |
weight_dir = pathlib.Path("plug-and-play/models/ldm/stable-diffusion-v1")
|
| 23 |
if not weight_dir.exists():
|
| 24 |
+
subprocess.run(shlex.split("mkdir -p plug-and-play/models/ldm/stable-diffusion-v1/"), check=True) # noqa: S603
|
| 25 |
+
subprocess.run( # noqa: S603
|
| 26 |
shlex.split(
|
| 27 |
"wget https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -O plug-and-play/models/ldm/stable-diffusion-v1/model.ckpt"
|
| 28 |
+
),
|
| 29 |
+
check=True,
|
| 30 |
)
|
| 31 |
|
| 32 |
+
with gr.Blocks(css_paths="style.css") as demo:
|
| 33 |
gr.Markdown(DESCRIPTION)
|
| 34 |
with gr.Tabs():
|
| 35 |
with gr.TabItem("Use real image as input"):
|
app_generated_image.py
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
|
| 3 |
-
from __future__ import annotations
|
| 4 |
-
|
| 5 |
import pathlib
|
| 6 |
import shlex
|
| 7 |
import subprocess
|
|
@@ -24,9 +22,9 @@ def gen_feature_extraction_config(
|
|
| 24 |
config.config.seed = seed
|
| 25 |
config.config.scale = guidance_scale
|
| 26 |
config.config.ddim_steps = ddim_steps
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
return temp_file.name
|
| 31 |
|
| 32 |
|
|
@@ -45,7 +43,9 @@ def run_feature_extraction_command(
|
|
| 45 |
guidance_scale,
|
| 46 |
ddim_steps,
|
| 47 |
)
|
| 48 |
-
subprocess.run(
|
|
|
|
|
|
|
| 49 |
return f"plug-and-play/experiments/{exp_name}/samples/0.png", exp_name
|
| 50 |
|
| 51 |
|
|
@@ -68,9 +68,9 @@ def gen_pnp_config(
|
|
| 68 |
config.negative_prompt = negative_prompt
|
| 69 |
config.negative_prompt_alpha = negative_prompt_alpha
|
| 70 |
config.negative_prompt_schedule = negative_prompt_schedule
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
return temp_file.name
|
| 75 |
|
| 76 |
|
|
@@ -94,7 +94,9 @@ def run_pnp_command(
|
|
| 94 |
negative_prompt_alpha,
|
| 95 |
negative_prompt_schedule,
|
| 96 |
)
|
| 97 |
-
subprocess.run(
|
|
|
|
|
|
|
| 98 |
|
| 99 |
out_dir = pathlib.Path(
|
| 100 |
f'plug-and-play/experiments/{exp_name}/translations/{guidance_scale}_{prompt.replace(" ", "_")}'
|
|
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
|
|
|
|
|
|
|
| 3 |
import pathlib
|
| 4 |
import shlex
|
| 5 |
import subprocess
|
|
|
|
| 22 |
config.config.seed = seed
|
| 23 |
config.config.scale = guidance_scale
|
| 24 |
config.config.ddim_steps = ddim_steps
|
| 25 |
+
with tempfile.NamedTemporaryFile(suffix=".yaml", delete=False) as temp_file:
|
| 26 |
+
with pathlib.Path(temp_file.name).open("w") as f:
|
| 27 |
+
f.write(OmegaConf.to_yaml(config))
|
| 28 |
return temp_file.name
|
| 29 |
|
| 30 |
|
|
|
|
| 43 |
guidance_scale,
|
| 44 |
ddim_steps,
|
| 45 |
)
|
| 46 |
+
subprocess.run( # noqa: S603
|
| 47 |
+
shlex.split(f"python run_features_extraction.py --config {config_path}"), cwd="plug-and-play", check=False
|
| 48 |
+
)
|
| 49 |
return f"plug-and-play/experiments/{exp_name}/samples/0.png", exp_name
|
| 50 |
|
| 51 |
|
|
|
|
| 68 |
config.negative_prompt = negative_prompt
|
| 69 |
config.negative_prompt_alpha = negative_prompt_alpha
|
| 70 |
config.negative_prompt_schedule = negative_prompt_schedule
|
| 71 |
+
with tempfile.NamedTemporaryFile(suffix=".yaml", delete=False) as temp_file:
|
| 72 |
+
with pathlib.Path(temp_file.name).open("w") as f:
|
| 73 |
+
f.write(OmegaConf.to_yaml(config))
|
| 74 |
return temp_file.name
|
| 75 |
|
| 76 |
|
|
|
|
| 94 |
negative_prompt_alpha,
|
| 95 |
negative_prompt_schedule,
|
| 96 |
)
|
| 97 |
+
subprocess.run( # noqa: S603
|
| 98 |
+
shlex.split(f"python run_pnp.py --config {config_path}"), cwd="plug-and-play", check=False
|
| 99 |
+
)
|
| 100 |
|
| 101 |
out_dir = pathlib.Path(
|
| 102 |
f'plug-and-play/experiments/{exp_name}/translations/{guidance_scale}_{prompt.replace(" ", "_")}'
|
app_real_image.py
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
|
| 3 |
-
from __future__ import annotations
|
| 4 |
-
|
| 5 |
import hashlib
|
| 6 |
import pathlib
|
| 7 |
import shlex
|
|
@@ -13,18 +11,17 @@ from omegaconf import OmegaConf
|
|
| 13 |
|
| 14 |
|
| 15 |
def get_exp_name(path: str) -> str:
|
| 16 |
-
with open(
|
| 17 |
-
|
| 18 |
-
return res
|
| 19 |
|
| 20 |
|
| 21 |
def gen_feature_extraction_config(exp_name: str, init_image_path: str) -> str:
|
| 22 |
config = OmegaConf.load("plug-and-play/configs/pnp/feature-extraction-real.yaml")
|
| 23 |
config.config.experiment_name = exp_name
|
| 24 |
config.config.init_img = init_image_path
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
return temp_file.name
|
| 29 |
|
| 30 |
|
|
@@ -32,7 +29,9 @@ def run_feature_extraction_command(init_image_path: str) -> tuple[str, str]:
|
|
| 32 |
exp_name = get_exp_name(init_image_path)
|
| 33 |
if not pathlib.Path(f"plug-and-play/experiments/{exp_name}").exists():
|
| 34 |
config_path = gen_feature_extraction_config(exp_name, init_image_path)
|
| 35 |
-
subprocess.run(
|
|
|
|
|
|
|
| 36 |
return f"plug-and-play/experiments/{exp_name}/samples/0.png", exp_name
|
| 37 |
|
| 38 |
|
|
@@ -55,9 +54,9 @@ def gen_pnp_config(
|
|
| 55 |
config.negative_prompt = negative_prompt
|
| 56 |
config.negative_prompt_alpha = negative_prompt_alpha
|
| 57 |
config.negative_prompt_schedule = negative_prompt_schedule
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
return temp_file.name
|
| 62 |
|
| 63 |
|
|
@@ -81,7 +80,9 @@ def run_pnp_command(
|
|
| 81 |
negative_prompt_alpha,
|
| 82 |
negative_prompt_schedule,
|
| 83 |
)
|
| 84 |
-
subprocess.run(
|
|
|
|
|
|
|
| 85 |
|
| 86 |
out_dir = pathlib.Path(
|
| 87 |
f'plug-and-play/experiments/{exp_name}/translations/{guidance_scale}_{prompt.replace(" ", "_")}'
|
|
@@ -106,7 +107,7 @@ def process_example(image: str, translation_prompt: str, negative_prompt: str) -
|
|
| 106 |
return reconstructed_image, exp_name, result
|
| 107 |
|
| 108 |
|
| 109 |
-
def create_real_image_demo():
|
| 110 |
with gr.Blocks() as demo:
|
| 111 |
with gr.Group():
|
| 112 |
gr.Markdown("Step 1 (This step will take about 5 minutes on A10G.)")
|
|
|
|
| 1 |
#!/usr/bin/env python
|
| 2 |
|
|
|
|
|
|
|
| 3 |
import hashlib
|
| 4 |
import pathlib
|
| 5 |
import shlex
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
def get_exp_name(path: str) -> str:
|
| 14 |
+
with pathlib.Path(path).open("rb") as f:
|
| 15 |
+
return hashlib.md5(f.read()).hexdigest() # noqa: S324
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
def gen_feature_extraction_config(exp_name: str, init_image_path: str) -> str:
|
| 19 |
config = OmegaConf.load("plug-and-play/configs/pnp/feature-extraction-real.yaml")
|
| 20 |
config.config.experiment_name = exp_name
|
| 21 |
config.config.init_img = init_image_path
|
| 22 |
+
with tempfile.NamedTemporaryFile(suffix=".yaml", delete=False) as temp_file:
|
| 23 |
+
with pathlib.Path(temp_file.name).open("w") as f:
|
| 24 |
+
f.write(OmegaConf.to_yaml(config))
|
| 25 |
return temp_file.name
|
| 26 |
|
| 27 |
|
|
|
|
| 29 |
exp_name = get_exp_name(init_image_path)
|
| 30 |
if not pathlib.Path(f"plug-and-play/experiments/{exp_name}").exists():
|
| 31 |
config_path = gen_feature_extraction_config(exp_name, init_image_path)
|
| 32 |
+
subprocess.run( # noqa: S603
|
| 33 |
+
shlex.split(f"python run_features_extraction.py --config {config_path}"), cwd="plug-and-play", check=False
|
| 34 |
+
)
|
| 35 |
return f"plug-and-play/experiments/{exp_name}/samples/0.png", exp_name
|
| 36 |
|
| 37 |
|
|
|
|
| 54 |
config.negative_prompt = negative_prompt
|
| 55 |
config.negative_prompt_alpha = negative_prompt_alpha
|
| 56 |
config.negative_prompt_schedule = negative_prompt_schedule
|
| 57 |
+
with tempfile.NamedTemporaryFile(suffix=".yaml", delete=False) as temp_file:
|
| 58 |
+
with pathlib.Path(temp_file.name).open("w") as f:
|
| 59 |
+
f.write(OmegaConf.to_yaml(config))
|
| 60 |
return temp_file.name
|
| 61 |
|
| 62 |
|
|
|
|
| 80 |
negative_prompt_alpha,
|
| 81 |
negative_prompt_schedule,
|
| 82 |
)
|
| 83 |
+
subprocess.run( # noqa: S603
|
| 84 |
+
shlex.split(f"python run_pnp.py --config {config_path}"), cwd="plug-and-play", check=False
|
| 85 |
+
)
|
| 86 |
|
| 87 |
out_dir = pathlib.Path(
|
| 88 |
f'plug-and-play/experiments/{exp_name}/translations/{guidance_scale}_{prompt.replace(" ", "_")}'
|
|
|
|
| 107 |
return reconstructed_image, exp_name, result
|
| 108 |
|
| 109 |
|
| 110 |
+
def create_real_image_demo() -> gr.Blocks:
|
| 111 |
with gr.Blocks() as demo:
|
| 112 |
with gr.Group():
|
| 113 |
gr.Markdown("Step 1 (This step will take about 5 minutes on A10G.)")
|
pyproject.toml
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "pnp-diffusion-features"
|
| 3 |
+
version = "0.1.0"
|
| 4 |
+
description = ""
|
| 5 |
+
readme = "README.md"
|
| 6 |
+
requires-python = ">=3.10"
|
| 7 |
+
dependencies = [
|
| 8 |
+
"albumentations>=1.4.24",
|
| 9 |
+
"clip",
|
| 10 |
+
"diffusers==0.12.1",
|
| 11 |
+
"einops>=0.8.0",
|
| 12 |
+
"gradio>=5.9.1",
|
| 13 |
+
"hf-transfer>=0.1.8",
|
| 14 |
+
"imageio[ffmpeg]>=2.36.1",
|
| 15 |
+
"kornia>=0.7.4",
|
| 16 |
+
"omegaconf>=2.3.0",
|
| 17 |
+
"opencv-python-headless>=4.10.0.84",
|
| 18 |
+
"python-slugify>=8.0.4",
|
| 19 |
+
"pytorch-lightning==1.9.0",
|
| 20 |
+
"scikit-learn>=1.6.0",
|
| 21 |
+
"taming-transformers",
|
| 22 |
+
"torch==1.13.1",
|
| 23 |
+
"torchvision>=0.14.1",
|
| 24 |
+
"transformers>=4.47.1",
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
[tool.ruff]
|
| 28 |
+
line-length = 119
|
| 29 |
+
|
| 30 |
+
[tool.ruff.lint]
|
| 31 |
+
select = ["ALL"]
|
| 32 |
+
ignore = [
|
| 33 |
+
"COM812", # missing-trailing-comma
|
| 34 |
+
"D203", # one-blank-line-before-class
|
| 35 |
+
"D213", # multi-line-summary-second-line
|
| 36 |
+
"E501", # line-too-long
|
| 37 |
+
"SIM117", # multiple-with-statements
|
| 38 |
+
]
|
| 39 |
+
extend-ignore = [
|
| 40 |
+
"D100", # undocumented-public-module
|
| 41 |
+
"D101", # undocumented-public-class
|
| 42 |
+
"D102", # undocumented-public-method
|
| 43 |
+
"D103", # undocumented-public-function
|
| 44 |
+
"D104", # undocumented-public-package
|
| 45 |
+
"D105", # undocumented-magic-method
|
| 46 |
+
"D107", # undocumented-public-init
|
| 47 |
+
"EM101", # raw-string-in-exception
|
| 48 |
+
"FBT001", # boolean-type-hint-positional-argument
|
| 49 |
+
"FBT002", # boolean-default-value-positional-argument
|
| 50 |
+
"PD901", # pandas-df-variable-name
|
| 51 |
+
"PGH003", # blanket-type-ignore
|
| 52 |
+
"PLR0913", # too-many-arguments
|
| 53 |
+
"PLR0915", # too-many-statements
|
| 54 |
+
"TRY003", # raise-vanilla-args
|
| 55 |
+
]
|
| 56 |
+
unfixable = [
|
| 57 |
+
"F401", # unused-import
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
+
[tool.ruff.format]
|
| 61 |
+
docstring-code-format = true
|
| 62 |
+
|
| 63 |
+
[tool.uv.sources]
|
| 64 |
+
clip = { git = "https://github.com/openai/CLIP.git" }
|
| 65 |
+
taming-transformers = { git = "https://github.com/CompVis/taming-transformers.git" }
|
requirements.txt
CHANGED
|
@@ -1,19 +1,333 @@
|
|
| 1 |
-
|
| 2 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
diffusers==0.12.1
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
omegaconf==2.3.0
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
pytorch-lightning==1.9.0
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
torch==1.13.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
torchvision==0.14.1
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file was autogenerated by uv via the following command:
|
| 2 |
+
# uv pip compile pyproject.toml -o requirements.txt
|
| 3 |
+
aiofiles==23.2.1
|
| 4 |
+
# via gradio
|
| 5 |
+
aiohappyeyeballs==2.4.4
|
| 6 |
+
# via aiohttp
|
| 7 |
+
aiohttp==3.11.11
|
| 8 |
+
# via fsspec
|
| 9 |
+
aiosignal==1.3.2
|
| 10 |
+
# via aiohttp
|
| 11 |
+
albucore==0.0.23
|
| 12 |
+
# via albumentations
|
| 13 |
+
albumentations==1.4.24
|
| 14 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 15 |
+
annotated-types==0.7.0
|
| 16 |
+
# via pydantic
|
| 17 |
+
antlr4-python3-runtime==4.9.3
|
| 18 |
+
# via omegaconf
|
| 19 |
+
anyio==4.7.0
|
| 20 |
+
# via
|
| 21 |
+
# gradio
|
| 22 |
+
# httpx
|
| 23 |
+
# starlette
|
| 24 |
+
async-timeout==5.0.1
|
| 25 |
+
# via aiohttp
|
| 26 |
+
attrs==24.3.0
|
| 27 |
+
# via aiohttp
|
| 28 |
+
certifi==2024.12.14
|
| 29 |
+
# via
|
| 30 |
+
# httpcore
|
| 31 |
+
# httpx
|
| 32 |
+
# requests
|
| 33 |
+
charset-normalizer==3.4.1
|
| 34 |
+
# via requests
|
| 35 |
+
click==8.1.8
|
| 36 |
+
# via
|
| 37 |
+
# typer
|
| 38 |
+
# uvicorn
|
| 39 |
+
clip @ git+https://github.com/openai/CLIP.git@dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1
|
| 40 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 41 |
diffusers==0.12.1
|
| 42 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 43 |
+
einops==0.8.0
|
| 44 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 45 |
+
exceptiongroup==1.2.2
|
| 46 |
+
# via anyio
|
| 47 |
+
fastapi==0.115.6
|
| 48 |
+
# via gradio
|
| 49 |
+
ffmpy==0.5.0
|
| 50 |
+
# via gradio
|
| 51 |
+
filelock==3.16.1
|
| 52 |
+
# via
|
| 53 |
+
# diffusers
|
| 54 |
+
# huggingface-hub
|
| 55 |
+
# transformers
|
| 56 |
+
frozenlist==1.5.0
|
| 57 |
+
# via
|
| 58 |
+
# aiohttp
|
| 59 |
+
# aiosignal
|
| 60 |
+
fsspec==2024.12.0
|
| 61 |
+
# via
|
| 62 |
+
# gradio-client
|
| 63 |
+
# huggingface-hub
|
| 64 |
+
# pytorch-lightning
|
| 65 |
+
ftfy==6.3.1
|
| 66 |
+
# via clip
|
| 67 |
+
gradio==5.9.1
|
| 68 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 69 |
+
gradio-client==1.5.2
|
| 70 |
+
# via gradio
|
| 71 |
+
h11==0.14.0
|
| 72 |
+
# via
|
| 73 |
+
# httpcore
|
| 74 |
+
# uvicorn
|
| 75 |
+
hf-transfer==0.1.8
|
| 76 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 77 |
+
httpcore==1.0.7
|
| 78 |
+
# via httpx
|
| 79 |
+
httpx==0.28.1
|
| 80 |
+
# via
|
| 81 |
+
# gradio
|
| 82 |
+
# gradio-client
|
| 83 |
+
# safehttpx
|
| 84 |
+
huggingface-hub==0.27.0
|
| 85 |
+
# via
|
| 86 |
+
# diffusers
|
| 87 |
+
# gradio
|
| 88 |
+
# gradio-client
|
| 89 |
+
# tokenizers
|
| 90 |
+
# transformers
|
| 91 |
+
idna==3.10
|
| 92 |
+
# via
|
| 93 |
+
# anyio
|
| 94 |
+
# httpx
|
| 95 |
+
# requests
|
| 96 |
+
# yarl
|
| 97 |
+
imageio==2.36.1
|
| 98 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 99 |
+
imageio-ffmpeg==0.5.1
|
| 100 |
+
# via imageio
|
| 101 |
+
importlib-metadata==8.5.0
|
| 102 |
+
# via diffusers
|
| 103 |
+
jinja2==3.1.5
|
| 104 |
+
# via gradio
|
| 105 |
+
joblib==1.4.2
|
| 106 |
+
# via scikit-learn
|
| 107 |
+
kornia==0.7.4
|
| 108 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 109 |
+
kornia-rs==0.1.8
|
| 110 |
+
# via kornia
|
| 111 |
+
lightning-utilities==0.11.9
|
| 112 |
+
# via
|
| 113 |
+
# pytorch-lightning
|
| 114 |
+
# torchmetrics
|
| 115 |
+
markdown-it-py==3.0.0
|
| 116 |
+
# via rich
|
| 117 |
+
markupsafe==2.1.5
|
| 118 |
+
# via
|
| 119 |
+
# gradio
|
| 120 |
+
# jinja2
|
| 121 |
+
mdurl==0.1.2
|
| 122 |
+
# via markdown-it-py
|
| 123 |
+
multidict==6.1.0
|
| 124 |
+
# via
|
| 125 |
+
# aiohttp
|
| 126 |
+
# yarl
|
| 127 |
+
numpy==2.2.1
|
| 128 |
+
# via
|
| 129 |
+
# albucore
|
| 130 |
+
# albumentations
|
| 131 |
+
# diffusers
|
| 132 |
+
# gradio
|
| 133 |
+
# imageio
|
| 134 |
+
# opencv-python-headless
|
| 135 |
+
# pandas
|
| 136 |
+
# pytorch-lightning
|
| 137 |
+
# scikit-learn
|
| 138 |
+
# scipy
|
| 139 |
+
# taming-transformers
|
| 140 |
+
# torchmetrics
|
| 141 |
+
# torchvision
|
| 142 |
+
# transformers
|
| 143 |
+
nvidia-cublas-cu11==11.10.3.66
|
| 144 |
+
# via
|
| 145 |
+
# nvidia-cudnn-cu11
|
| 146 |
+
# torch
|
| 147 |
+
nvidia-cuda-nvrtc-cu11==11.7.99
|
| 148 |
+
# via torch
|
| 149 |
+
nvidia-cuda-runtime-cu11==11.7.99
|
| 150 |
+
# via torch
|
| 151 |
+
nvidia-cudnn-cu11==8.5.0.96
|
| 152 |
+
# via torch
|
| 153 |
omegaconf==2.3.0
|
| 154 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 155 |
+
opencv-python-headless==4.10.0.84
|
| 156 |
+
# via
|
| 157 |
+
# pnp-diffusion-features (pyproject.toml)
|
| 158 |
+
# albucore
|
| 159 |
+
# albumentations
|
| 160 |
+
orjson==3.10.13
|
| 161 |
+
# via gradio
|
| 162 |
+
packaging==24.2
|
| 163 |
+
# via
|
| 164 |
+
# clip
|
| 165 |
+
# gradio
|
| 166 |
+
# gradio-client
|
| 167 |
+
# huggingface-hub
|
| 168 |
+
# kornia
|
| 169 |
+
# lightning-utilities
|
| 170 |
+
# pytorch-lightning
|
| 171 |
+
# torchmetrics
|
| 172 |
+
# transformers
|
| 173 |
+
pandas==2.2.3
|
| 174 |
+
# via gradio
|
| 175 |
+
pillow==11.0.0
|
| 176 |
+
# via
|
| 177 |
+
# diffusers
|
| 178 |
+
# gradio
|
| 179 |
+
# imageio
|
| 180 |
+
# torchvision
|
| 181 |
+
propcache==0.2.1
|
| 182 |
+
# via
|
| 183 |
+
# aiohttp
|
| 184 |
+
# yarl
|
| 185 |
+
psutil==6.1.1
|
| 186 |
+
# via imageio
|
| 187 |
+
pydantic==2.10.4
|
| 188 |
+
# via
|
| 189 |
+
# albumentations
|
| 190 |
+
# fastapi
|
| 191 |
+
# gradio
|
| 192 |
+
pydantic-core==2.27.2
|
| 193 |
+
# via pydantic
|
| 194 |
+
pydub==0.25.1
|
| 195 |
+
# via gradio
|
| 196 |
+
pygments==2.18.0
|
| 197 |
+
# via rich
|
| 198 |
+
python-dateutil==2.9.0.post0
|
| 199 |
+
# via pandas
|
| 200 |
+
python-multipart==0.0.20
|
| 201 |
+
# via gradio
|
| 202 |
+
python-slugify==8.0.4
|
| 203 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 204 |
pytorch-lightning==1.9.0
|
| 205 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 206 |
+
pytz==2024.2
|
| 207 |
+
# via pandas
|
| 208 |
+
pyyaml==6.0.2
|
| 209 |
+
# via
|
| 210 |
+
# albumentations
|
| 211 |
+
# gradio
|
| 212 |
+
# huggingface-hub
|
| 213 |
+
# omegaconf
|
| 214 |
+
# pytorch-lightning
|
| 215 |
+
# transformers
|
| 216 |
+
regex==2024.11.6
|
| 217 |
+
# via
|
| 218 |
+
# clip
|
| 219 |
+
# diffusers
|
| 220 |
+
# transformers
|
| 221 |
+
requests==2.32.3
|
| 222 |
+
# via
|
| 223 |
+
# diffusers
|
| 224 |
+
# huggingface-hub
|
| 225 |
+
# torchvision
|
| 226 |
+
# transformers
|
| 227 |
+
rich==13.9.4
|
| 228 |
+
# via typer
|
| 229 |
+
ruff==0.8.4
|
| 230 |
+
# via gradio
|
| 231 |
+
safehttpx==0.1.6
|
| 232 |
+
# via gradio
|
| 233 |
+
safetensors==0.4.5
|
| 234 |
+
# via transformers
|
| 235 |
+
scikit-learn==1.6.0
|
| 236 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 237 |
+
scipy==1.14.1
|
| 238 |
+
# via
|
| 239 |
+
# albumentations
|
| 240 |
+
# scikit-learn
|
| 241 |
+
semantic-version==2.10.0
|
| 242 |
+
# via gradio
|
| 243 |
+
setuptools==75.6.0
|
| 244 |
+
# via
|
| 245 |
+
# imageio-ffmpeg
|
| 246 |
+
# lightning-utilities
|
| 247 |
+
# nvidia-cublas-cu11
|
| 248 |
+
# nvidia-cuda-runtime-cu11
|
| 249 |
+
shellingham==1.5.4
|
| 250 |
+
# via typer
|
| 251 |
+
simsimd==6.2.1
|
| 252 |
+
# via albucore
|
| 253 |
+
six==1.17.0
|
| 254 |
+
# via python-dateutil
|
| 255 |
+
sniffio==1.3.1
|
| 256 |
+
# via anyio
|
| 257 |
+
starlette==0.41.3
|
| 258 |
+
# via
|
| 259 |
+
# fastapi
|
| 260 |
+
# gradio
|
| 261 |
+
stringzilla==3.11.3
|
| 262 |
+
# via albucore
|
| 263 |
+
taming-transformers @ git+https://github.com/CompVis/taming-transformers.git@3ba01b241669f5ade541ce990f7650a3b8f65318
|
| 264 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 265 |
+
text-unidecode==1.3
|
| 266 |
+
# via python-slugify
|
| 267 |
+
threadpoolctl==3.5.0
|
| 268 |
+
# via scikit-learn
|
| 269 |
+
tokenizers==0.21.0
|
| 270 |
+
# via transformers
|
| 271 |
+
tomlkit==0.13.2
|
| 272 |
+
# via gradio
|
| 273 |
torch==1.13.1
|
| 274 |
+
# via
|
| 275 |
+
# pnp-diffusion-features (pyproject.toml)
|
| 276 |
+
# clip
|
| 277 |
+
# kornia
|
| 278 |
+
# pytorch-lightning
|
| 279 |
+
# taming-transformers
|
| 280 |
+
# torchmetrics
|
| 281 |
+
# torchvision
|
| 282 |
+
torchmetrics==1.5.2
|
| 283 |
+
# via pytorch-lightning
|
| 284 |
torchvision==0.14.1
|
| 285 |
+
# via
|
| 286 |
+
# pnp-diffusion-features (pyproject.toml)
|
| 287 |
+
# clip
|
| 288 |
+
tqdm==4.67.1
|
| 289 |
+
# via
|
| 290 |
+
# clip
|
| 291 |
+
# huggingface-hub
|
| 292 |
+
# pytorch-lightning
|
| 293 |
+
# taming-transformers
|
| 294 |
+
# transformers
|
| 295 |
+
transformers==4.47.1
|
| 296 |
+
# via pnp-diffusion-features (pyproject.toml)
|
| 297 |
+
typer==0.15.1
|
| 298 |
+
# via gradio
|
| 299 |
+
typing-extensions==4.12.2
|
| 300 |
+
# via
|
| 301 |
+
# anyio
|
| 302 |
+
# fastapi
|
| 303 |
+
# gradio
|
| 304 |
+
# gradio-client
|
| 305 |
+
# huggingface-hub
|
| 306 |
+
# lightning-utilities
|
| 307 |
+
# multidict
|
| 308 |
+
# pydantic
|
| 309 |
+
# pydantic-core
|
| 310 |
+
# pytorch-lightning
|
| 311 |
+
# rich
|
| 312 |
+
# torch
|
| 313 |
+
# torchvision
|
| 314 |
+
# typer
|
| 315 |
+
# uvicorn
|
| 316 |
+
tzdata==2024.2
|
| 317 |
+
# via pandas
|
| 318 |
+
urllib3==2.3.0
|
| 319 |
+
# via requests
|
| 320 |
+
uvicorn==0.34.0
|
| 321 |
+
# via gradio
|
| 322 |
+
wcwidth==0.2.13
|
| 323 |
+
# via ftfy
|
| 324 |
+
websockets==14.1
|
| 325 |
+
# via gradio-client
|
| 326 |
+
wheel==0.45.1
|
| 327 |
+
# via
|
| 328 |
+
# nvidia-cublas-cu11
|
| 329 |
+
# nvidia-cuda-runtime-cu11
|
| 330 |
+
yarl==1.18.3
|
| 331 |
+
# via aiohttp
|
| 332 |
+
zipp==3.21.0
|
| 333 |
+
# via importlib-metadata
|
uv.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|