Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
eb35786
Bump comfyui-frontend-package to 1.51.10 (#16118)
comfy-pr-bot Sep 7, 2026
313a76f
Disable int8 weight-only quantization on devices without torch._int_m…
chelsealong Sep 7, 2026
9ac7352
Fix registration issues (#15890)
guill Sep 7, 2026
41db8f4
Verify aotriton kernels actually launch before enabling pytorch atten…
0xDELUXA Sep 7, 2026
f5ed117
Remove useless code. (#16169)
comfyanonymous Sep 7, 2026
5bbdf8a
chore: Harmonize model attention nodes (#16154)
alexisrolland Sep 8, 2026
efa6c8f
Add LTXV generated-keyframe nodes and Freeze Latent (#16040)
adamoster Sep 8, 2026
00d34d9
Comfy Aimdo 0.5.3 + Memory compiler fixes (#16180)
rattus128 Sep 8, 2026
488e8f8
feat: Pixal3D multiview model support (CORE-421) (#16048)
kijai Sep 8, 2026
b7ebfd7
Fix quantized text encoder matmul gating and Gemma4 prefill cache pos…
kijai Sep 8, 2026
249c5a3
Cleaner way of enabling quantized mm on text gen but not on text enc.…
comfyanonymous Sep 8, 2026
0d0b6b5
Add LTXVAddLatentGuide for pinning a pre-encoded latent as a guide (#…
alexanderar Sep 8, 2026
421a1c2
Fix MiniMax H3 denoise masks (#15988)
poorpaper Sep 8, 2026
672ba9e
Only lock repo PRs after merging if they contain a CLA signature. (#1…
comfyanonymous Sep 9, 2026
be47aa2
[Partner Nodes] feat(OpenAI): add GPT Image 2.5 Flare and Sunburst mo…
bigcat88 Sep 9, 2026
02dfb63
chores: Update tooltips of 3D nodes (CORE-323) (#16179)
alexisrolland Sep 9, 2026
6517734
chore: update workflow templates to v0.11.57 (#16192)
comfyui-wiki Sep 9, 2026
3074d0e
Report the file saved by Save 3D (Advanced) as a standard 3d output i…
jtydhr88 Sep 9, 2026
40c4fcd
ComfyUI v0.35.0
comfyanonymous Sep 9, 2026
54e03f5
Add new model blueprints and reorganize subgraph categories (#14785)
comfyui-wiki Sep 9, 2026
6f3895e
main: bump the AMD Windows VA quota to 4TB (#16199)
rattus128 Sep 9, 2026
4989cdd
[Partner Noes] feat(OpenRouter): add Microsoft `mai-image-2.6` models…
bigcat88 Sep 9, 2026
be92396
quant_ops: drop the dead ROCm triton arch gate (#16211)
0xDELUXA Sep 9, 2026
7ea14e5
[Partner Nodes] feat(Gemini-LLM): Add Gemini 3.8 Flash to the Gemini …
bigcat88 Sep 10, 2026
a7b1d39
Update instructions for manual install on windows AMD. (#16217)
comfyanonymous Sep 10, 2026
6eba895
[Partner Nodes] feat(Tripo): migrate to the v3 API, add the Smart Seg…
bigcat88 Sep 10, 2026
5774ab9
[Partner Nodes] feat(OpenRouter): add auto aspect ratio to the MAI im…
bigcat88 Sep 10, 2026
1f641fd
chore: update workflow templates to v0.11.59 (#16233)
comfyui-wiki Sep 10, 2026
6338e4b
Fix h3 fun controlnet with comfy compiler. (#16240)
comfyanonymous Sep 10, 2026
1d48d9c
Add linear to ImageColorSpace. (#16247)
comfyanonymous Sep 11, 2026
d537de9
Implement Video Concatenate (CORE-436) (#16267)
rattus128 Sep 11, 2026
c40c94e
Fix unit tests (#16271)
alexisrolland Sep 11, 2026
1d91a82
feat: Marigold v2 support (CORE-431) (#16232)
kijai Sep 11, 2026
b058ec6
Support Yue2 music model. (#16250)
comfyanonymous Sep 11, 2026
7193f56
Bump comfyui-frontend-package to 1.52.7 (#16275)
christian-byrne Sep 12, 2026
c75d8c9
[Partner Nodes] feat(Bria): add new image edit nodes and the Video Er…
bigcat88 Sep 12, 2026
9113c08
[Partner Nodes] feat(client): consume estimated-duration headers for …
bigcat88 Sep 12, 2026
7dac1d2
Increase max song duration in Yue2 node. (#16292)
comfyanonymous Sep 12, 2026
7ba217d
Don't add noise to the alpha channel in the Add Noise to Image node (…
christian-byrne Sep 12, 2026
a20738f
Fix linear_input_act to respect _full_precision_mm fallback (#16285)
chelsealong Sep 12, 2026
98c7334
Fix yue2 AMD issues and add more controls to the generate ABC node. (…
comfyanonymous Sep 12, 2026
d43a5fa
Log typed asset scanner filesystem errors (#16096)
christian-byrne Sep 12, 2026
02d39c8
[Partner Nodes] feat(BFL): add the Flux Video Edit node (#16259)
bigcat88 Sep 13, 2026
798fa9a
Add that Yue 2 is supported to readme. (#16303)
comfyanonymous Sep 13, 2026
19e1058
feat(assets): split asset records from content (#16295)
synap5e Sep 13, 2026
eecbfb4
test(assets): keep test typing 3.10-compatible (#16305)
synap5e Sep 14, 2026
f42b24e
feat: structured event log lines for the assets system (#16306)
christian-byrne Sep 14, 2026
b005849
[Partner Nodes] feat(Gemini-LLM): add GeminiNodeV3, deprecate V2 (#16…
bigcat88 Sep 14, 2026
683421b
Add Marigold V2 and YuE2 blueprints (#16318)
comfyui-wiki Sep 14, 2026
db70adb
chore: update workflow templates to v0.11.60 (#16319)
comfyui-wiki Sep 14, 2026
50ab50c
Implement Generic Loops (Candidate III - implemented ✅) (CORE-14) (#1…
rattus128 Sep 14, 2026
a2afcdb
comfy-execution: cache: cache errors is RAM cache sizing scan (#16314)
rattus128 Sep 14, 2026
6cff1e9
Use comfy kitchen apply rope in llama based models. (#16326)
comfyanonymous Sep 15, 2026
9a600f8
Update comfy-kitchen version to 0.2.34 (#16329)
comfyanonymous Sep 15, 2026
b2e31e8
MiniMax-H3 VAE optimizations (#16187)
kijai Sep 15, 2026
f14bbe2
Lower minimax VAE usage by a bit. (#16332)
comfyanonymous Sep 15, 2026
36da3ff
Temporarily disable testing with `--enable-assets` (#16334)
guill Sep 15, 2026
e09be59
[Partner Nodes] feat(Pruna): add text-to-video and image-to-video nod…
bigcat88 Sep 15, 2026
1a14b82
[Partner Nodes] feat(Tripo): add Tripo P2 text, image and multiview t…
bigcat88 Sep 15, 2026
a84f954
Carry every item of a heterogeneous list through a loop (#16345)
L4XB Sep 15, 2026
b2da2b4
Declare loop boundaries in node schema (#16347)
rattus128 Sep 15, 2026
9b57234
Make llama apply rope use fast kernels on more models. (#16351)
comfyanonymous Sep 15, 2026
a78a22e
Update workflow templates to v0.11.62 (#16350)
comfyui-wiki Sep 15, 2026
ee71d5c
ComfyUI v0.36.0
comfyanonymous Sep 15, 2026
7a0b5ee
Aimdo 0.5.5 + Auto-detect and enable --fast-disk when the disk is fas…
rattus128 Sep 15, 2026
8ad078b
Add transparent background option for GPT Image 2 (#16366)
bigcat88 Sep 16, 2026
4e779e5
Add CFG control to YuE2 Generate Music node (#16373)
comfyanonymous Sep 17, 2026
d39cdfd
Always put text encoder on GPU when dynamic vram on. (#16374)
comfyanonymous Sep 17, 2026
387f98a
[Partner Nodes] fix(Tripo): refuse a P2 run whose linked GLB or FBX o…
bigcat88 Sep 17, 2026
a2f455c
feat: Support MoGe 3 (CORE-443) (#16381)
kijai Sep 17, 2026
cf5cc2b
Update comfy-kitchen version to 0.2.35 (#16385)
comfyanonymous Sep 17, 2026
fd88b3c
Update default width and height in EmptyLatentImage (#16384)
alexisrolland Sep 17, 2026
7de9922
chores: Update nodes names and categories (#16274)
alexisrolland Sep 17, 2026
9a77c1d
Qwen3/3.5/3.8 cudagraphs and w4a8 gemv support (CORE-390) (#15623)
kijai Sep 18, 2026
4d7e61b
Fix issue with qwen speedup PR. (#16389)
comfyanonymous Sep 18, 2026
944386c
Lower the pos embed precision of SheetSage2 to match upstream. (#16395)
comfyanonymous Sep 18, 2026
a8686f2
[Partner Nodes] feat(client): send Idempotency-Key on partner-proxy c…
bigcat88 Sep 18, 2026
0d90172
Bump comfyui-frontend-package to 1.53.6 (#16386)
comfy-pr-bot Sep 18, 2026
3c80da7
Fix ace step VAE decode crashing on non bf16 GPUs. (#16405)
comfyanonymous Sep 18, 2026
6bfaacc
feat: Qwen-image 2.1 support (CORE-423) (#16400)
kijai Sep 19, 2026
00abd23
chore: update embedded docs to v0.5.12 (#16396)
comfyui-wiki Sep 19, 2026
c8ed2c8
Lower wan peak vram when using comfy kitchen attention. (#16418)
comfyanonymous Sep 20, 2026
96be9a1
chore: update workflow templates to v0.11.65 (#16423)
comfyui-wiki Sep 20, 2026
5ba116a
Add --disable-fast-disk to disable fast disk. (#16424)
comfyanonymous Sep 20, 2026
19c7983
chore: update workflow templates to v0.11.66 (#16426)
comfyui-wiki Sep 20, 2026
3dd559d
[Partner Nodes] feat(Meshy): add Meshy 7.1 support (#16412)
bigcat88 Sep 20, 2026
9907383
Fix MiniMax Music 3 producing noise with CUDA graphs enabled. (#16428)
RaynoldVanHeyningen Sep 20, 2026
73c9bad
ComfyUI v0.37.0
comfyanonymous Sep 20, 2026
0f74f7f
Bump back frontend to 1.53.6 after dowgrading it on the stable commit.
comfyanonymous Sep 20, 2026
2f7c6d4
Improve qwen 2.1 KV cache location logic (#16429)
rattus128 Sep 20, 2026
1d61dcc
Compile Qwen Image 2.1 transformer blocks (#16430)
rattus128 Sep 20, 2026
c194dd0
Allow model files to contain which attention should be used for each …
comfyanonymous Sep 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 27 additions & 3 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build author-only allowlist
id: allowlist
if: >
github.event_name == 'pull_request_target' ||
(github.event_name == 'pull_request_target' && github.event.action != 'closed') ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && (
github.event.comment.body == 'recheck' ||
github.event.comment.body == 'I have read and agree to the Contributor License Agreement'
Expand All @@ -48,10 +48,10 @@ jobs:
fi

- name: CLA Assistant
# Run on PR events, on "recheck" comment, or when someone posts the signing phrase.
# Run on open/update PR events, on "recheck", or when someone posts the signing phrase.
# IMPORTANT: this phrase must match `custom-pr-sign-comment` below.
if: >
github.event_name == 'pull_request_target' ||
(github.event_name == 'pull_request_target' && github.event.action != 'closed') ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && (
github.event.comment.body == 'recheck' ||
github.event.comment.body == 'I have read and agree to the Contributor License Agreement'
Expand All @@ -62,6 +62,8 @@ jobs:
# PAT required to write to the centralized signatures repo.
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
lock-pullrequest-aftermerge: false

# Where the CLA document lives (shown to contributors)
path-to-document: https://github.com/Comfy-Org/comfy-cla/blob/main/comfyui_icla.md

Expand Down Expand Up @@ -94,3 +96,25 @@ jobs:

custom-allsigned-prcomment: |
✅ All contributors have signed the CLA. Thank you! This PR is ready to be merged.

- name: Lock PR containing a CLA signature or bot approval
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
uses: actions/github-script@v7
with:
retries: 3
script: |
const pr = context.payload.pull_request;
const issue = { ...context.repo, issue_number: pr.number };
const comments = await github.paginate(github.rest.issues.listComments, {
...issue,
per_page: 100,
});
const signed = comments.some(comment =>
(comment.user?.id === pr.user.id &&
comment.body?.trim().toLowerCase() === 'i have read and agree to the contributor license agreement') ||
(comment.user?.login === 'github-actions[bot]' &&
comment.body?.startsWith('✅ All contributors have signed the CLA. Thank you! This PR is ready to be merged.'))
);
if (signed) {
await github.rest.issues.lock(issue);
}
21 changes: 21 additions & 0 deletions QUANTIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,27 @@ Example:

To create compatible checkpoints, use any quantization tool provided the output follows the checkpoint format described above and uses a layout defined in `QUANT_ALGOS`.

### Diffusion attention preferences

A diffusion attention module can have a `<module path>.comfy_attention.config` entry whose
uint8 tensor contains UTF-8 JSON:

```json
{"attention": "comfy_kitchen_int8"}
```

Use the module that performs attention, such as `transformer_blocks.0.attn` for
Qwen Image 2.1 or `blocks.0.attn` for MiniMax H3.

Only `comfy_kitchen_int8` is supported. Invalid targets and other method names
are ignored with a warning during loading, leaving normal attention selection.
Kitchen INT8 support is checked when each preference is loaded
for the primary device; unsupported devices keep normal attention selection.
Explicit attention overrides retain priority.
The `ComfyAttention` child module loads and saves its own metadata through normal
state-dict loading and saving. Preferences do not enable weight
quantization. Text encoder and VAE loaders do not apply these preferences.

### Weight Quantization

Weight quantization is straightforward - compute the scaling factor directly from the weight tensor using the absolute maximum method described earlier. Each layer's weights are quantized independently and stored with their corresponding `weight_scale` parameter.
Expand Down
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ See what ComfyUI can do with the [newer template workflows](https://comfy.org/wo
- [Image editing](https://comfy.org/workflows/tag/image-edit/): Flux Kontext, Flux.2 Klein, Qwen Image Edit, HiDream E1.1 and O1, OmniGen2, Boogu, JoyImage Edit, MageFlow Edit, and LongCat Image Edit.
- [Video generation](https://comfy.org/workflows/tag/video-generation/): Wan 2.1 and 2.2, LTX-Video 2 and 2.3, HunyuanVideo 1.5, Kandinsky 5 Video, CogVideoX, Cosmos Predict2, Bernini-R, SCAIL 2, and Mochi.
- [Audio and video generation](https://comfy.org/workflows/): MiniMax H3 and LTX-AV.
- [Audio generation](https://comfy.org/workflows/tag/text-to-audio/): ACE-Step 1.5, Stable Audio 3 and MiniMax Music 3
- [Audio generation](https://comfy.org/workflows/tag/text-to-audio/): ACE-Step 1.5, Stable Audio 3, MiniMax Music 3 and Yue 2.
- [3D and vision](https://comfy.org/workflows/): Hunyuan3D 2.1, TripoSplat, SeedVR2, SUPIR, Depth Anything 3, MoGe, SAM 3 and 3.1, RT-DETRv4, and BiRefNet.
- [Text generation](https://comfy.org/workflows/tag/text-generation/): Gemma 3 and 4, Qwen3, Qwen3.5, and Qwen3-VL, including multimodal inputs.
- Load complete checkpoints or separate diffusion models, VAEs, text encoders, LoRAs, ControlNets, adapters, and upscalers from supported model formats.
Expand Down Expand Up @@ -214,21 +214,30 @@ This is the command to install the nightly with ROCm 7.2 which might have some p
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm7.2```


### AMD GPUs (Experimental: Windows and Linux), RDNA 3, 3.5 and 4 only.
### AMD GPUs (Windows, ROCm 10.0)

These have less hardware support than the builds above but they work on windows. You also need to install the pytorch version specific to your hardware.
Use AMD's [multi-architecture PyTorch packages](https://rocm.docs.amd.com/projects/ai-ecosystem/en/latest/frameworks/pytorch/install.html). The `device-*` extras install your GPU's kernels and the matching ROCm runtime automatically; a separate HIP SDK installation is not needed.

RDNA 3 (RX 7000 series):
Use Windows 11, a current [AMD graphics driver](https://www.amd.com/en/support/download/drivers.html), and 64-bit Python 3.13.

```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx110X-all/```
The install command below uses `device-all` to install kernels for all supported GPUs. To reduce download size and disk usage, optionally replace **both** occurrences of `device-all` with the target for your GPU:

RDNA 3.5 (Strix halo/Ryzen AI Max+ 365):
| GPU | Device extra |
| --- | --- |
| RX 9070 / XT, Radeon AI PRO R9700 | `device-gfx1201` |
| RX 9060 / XT | `device-gfx1200` |
| RX 7900 XT / XTX | `device-gfx1100` |
| RX 7700 XT / 7800 XT | `device-gfx1101` |
| RX 7600 / XT | `device-gfx1102` |
| Ryzen AI Max / Max+ (Strix Halo) | `device-gfx1151` |

```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx1151/```
**Note:** This table only lists examples. A GPU missing from it may still be supported: supported architectures include RDNA 2, RDNA 3, RDNA 3.5, and RDNA 4. Keep `device-all` to install kernels for all supported targets. For other models, see AMD's [GPU target table](https://github.com/ROCm/TheRock/blob/main/RELEASES.md#gfx-target-lookup-table) and [ROCm compatibility matrix](https://rocm.docs.amd.com/en/docs-10.0.0/compatibility/compatibility-matrix.html).

RDNA 4 (RX 9000 series):
**ROCm 10.0.0 with PyTorch 2.13:**

```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/```
```bat
pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "torch[device-all]==2.13.0+rocm10.0.0" "torchvision[device-all]==0.28.0+rocm10.0.0" "torchaudio==2.11.0.2+rocm10.0.0"
```

### Intel GPUs (Windows and Linux)

Expand Down
2 changes: 0 additions & 2 deletions alembic_db/versions/0001_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def downgrade() -> None:

op.drop_index("ix_asset_cache_state_asset_id", table_name="asset_cache_state")
op.drop_index("ix_asset_cache_state_file_path", table_name="asset_cache_state")
op.drop_constraint("uq_asset_cache_state_file_path", table_name="asset_cache_state")
op.drop_table("asset_cache_state")

op.drop_index("ix_asset_info_tags_asset_info_id", table_name="asset_info_tags")
Expand All @@ -160,7 +159,6 @@ def downgrade() -> None:
op.drop_index("ix_tags_tag_type", table_name="tags")
op.drop_table("tags")

op.drop_constraint("uq_assets_info_asset_owner_name", table_name="assets_info")
op.drop_index("ix_assets_info_owner_name", table_name="assets_info")
op.drop_index("ix_assets_info_last_access_time", table_name="assets_info")
op.drop_index("ix_assets_info_created_at", table_name="assets_info")
Expand Down
5 changes: 4 additions & 1 deletion alembic_db/versions/0002_merge_to_asset_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ def downgrade() -> None:

NOTE: Data is not recoverable. The upgrade discards all rows from the old
tables and truncates assets. After downgrade the old schema will be empty.
A filesystem rescan will repopulate data once the older code is running.
A filesystem rescan can repopulate only data derived from paths. It will
not restore user_metadata, manually-applied tags, preview_id nominations,
name renames, or job_id, because build_asset_specs derives names and tags
from the path alone.
"""
# Drop new tables (order matters due to FK constraints)
op.drop_index("ix_asset_reference_meta_key_val_bool", table_name="asset_reference_meta")
Expand Down
125 changes: 125 additions & 0 deletions alembic_db/versions/0007_record_content_split.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
"""
Record/content split.
This migration intentionally discards the existing asset database. The
asset_reference_meta, asset_reference_tags, asset_references, and assets
tables are dropped, and DELETE FROM tags removes all existing tag rows. No
data migration is performed.
A filesystem rescan after this migration will not restore user_metadata,
manually-applied tags, preview_id nominations, name renames, or job_id.
build_asset_specs derives names and tags from the path alone.
Revision ID: 0007_record_content_split
Revises: 0006_add_loader_path
Create Date: 2026-08-26
"""

from alembic import op
import sqlalchemy as sa


revision = "0007_record_content_split"
down_revision = "0006_add_loader_path"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.drop_table("asset_reference_meta")
op.drop_table("asset_reference_tags")
op.drop_table("asset_references")
op.drop_table("assets")
op.execute("DELETE FROM tags")
op.create_table(
"asset_contents",
sa.Column("id", sa.String(36), primary_key=True),
sa.Column("hash", sa.String(256)),
sa.Column("size_bytes", sa.BigInteger(), nullable=False),
sa.Column("path", sa.Text(), nullable=False),
sa.Column("mtime_ns", sa.BigInteger()),
sa.Column("is_missing", sa.Boolean(), nullable=False, server_default="0"),
sa.Column("created_at", sa.DateTime(), nullable=False),
sa.CheckConstraint("size_bytes >= 0", name="ck_asset_contents_size_nonneg"),
sa.CheckConstraint("mtime_ns >= 0", name="ck_asset_contents_mtime_nonneg"),
)
op.create_index("ix_asset_contents_hash", "asset_contents", ["hash"])
op.create_index(
"uq_asset_contents_path_live", "asset_contents", ["path"], unique=True,
sqlite_where=sa.text("is_missing = 0"),
)
op.create_table(
"assets",
sa.Column("id", sa.String(36), primary_key=True),
sa.Column("content_id", sa.String(36), sa.ForeignKey("asset_contents.id", ondelete="RESTRICT"), nullable=False),
sa.Column("name", sa.String(512), nullable=False),
sa.Column("mime_type", sa.String(255)),
sa.Column("system_metadata", sa.JSON()),
sa.Column("job_id", sa.String(36)),
sa.Column("user_metadata", sa.JSON()),
sa.Column("loader_path", sa.Text()),
sa.Column("preview_id", sa.String(36), sa.ForeignKey("assets.id", ondelete="SET NULL")),
sa.Column("created_at", sa.DateTime(), nullable=False),
sa.Column("updated_at", sa.DateTime(), nullable=False),
sa.Column("last_access_time", sa.DateTime()),
)
op.create_index("ix_assets_content_id", "assets", ["content_id"])
op.create_index("ix_assets_name", "assets", ["name"])
op.create_index("ix_assets_created_at", "assets", ["created_at"])
op.create_index("ix_assets_preview_id", "assets", ["preview_id"])
op.create_table(
"asset_meta",
sa.Column("asset_id", sa.String(36), sa.ForeignKey("assets.id", ondelete="CASCADE"), primary_key=True),
sa.Column("key", sa.String(256), primary_key=True),
sa.Column("ordinal", sa.Integer(), primary_key=True),
sa.Column("val_str", sa.String(2048)), sa.Column("val_num", sa.Numeric(38, 10)),
sa.Column("val_bool", sa.Boolean()), sa.Column("val_json", sa.JSON()),
sa.CheckConstraint("val_str IS NOT NULL OR val_num IS NOT NULL OR val_bool IS NOT NULL OR val_json IS NOT NULL", name="ck_asset_meta_has_value"),
)
op.create_index("ix_asset_meta_key", "asset_meta", ["key"])
op.create_index("ix_asset_meta_key_val_str", "asset_meta", ["key", "val_str"])
op.create_index("ix_asset_meta_key_val_num", "asset_meta", ["key", "val_num"])
op.create_index("ix_asset_meta_key_val_bool", "asset_meta", ["key", "val_bool"])
op.create_table("asset_tags", sa.Column("asset_id", sa.String(36), sa.ForeignKey("assets.id", ondelete="CASCADE"), primary_key=True), sa.Column("tag_name", sa.String(512), sa.ForeignKey("tags.name", ondelete="RESTRICT"), primary_key=True), sa.Column("origin", sa.String(32), nullable=False), sa.Column("added_at", sa.DateTime(), nullable=False))
op.create_index("ix_asset_tags_tag_name", "asset_tags", ["tag_name"])
op.create_index("ix_asset_tags_asset_id", "asset_tags", ["asset_id"])
op.create_table("asset_system_state", sa.Column("key", sa.String(256), primary_key=True), sa.Column("value", sa.Text(), nullable=False))


def downgrade() -> None:
op.drop_table("asset_system_state")
op.drop_table("asset_tags")
op.drop_table("asset_meta")
op.drop_table("assets")
op.drop_table("asset_contents")
op.create_table(
"assets",
sa.Column("id", sa.String(length=36), primary_key=True),
sa.Column("hash", sa.String(length=256), nullable=True),
sa.Column("size_bytes", sa.BigInteger(), nullable=False, server_default="0"),
sa.Column("mime_type", sa.String(length=255), nullable=True),
sa.Column("created_at", sa.DateTime(timezone=False), nullable=False),
sa.CheckConstraint("size_bytes >= 0", name="ck_assets_size_nonneg"),
)
op.create_index("uq_assets_hash", "assets", ["hash"], unique=True)
op.create_index("ix_assets_mime_type", "assets", ["mime_type"])
op.create_table("asset_references", sa.Column("id", sa.String(36), primary_key=True), sa.Column("asset_id", sa.String(36), sa.ForeignKey("assets.id", ondelete="CASCADE"), nullable=False), sa.Column("file_path", sa.Text()), sa.Column("loader_path", sa.Text()), sa.Column("mtime_ns", sa.BigInteger()), sa.Column("needs_verify", sa.Boolean(), nullable=False), sa.Column("is_missing", sa.Boolean(), nullable=False), sa.Column("enrichment_level", sa.Integer(), nullable=False), sa.Column("owner_id", sa.String(128), nullable=False), sa.Column("name", sa.String(512), nullable=False), sa.Column("preview_id", sa.String(36), sa.ForeignKey("asset_references.id", ondelete="SET NULL")), sa.Column("user_metadata", sa.JSON()), sa.Column("system_metadata", sa.JSON()), sa.Column("job_id", sa.String(36)), sa.Column("created_at", sa.DateTime(), nullable=False), sa.Column("updated_at", sa.DateTime(), nullable=False), sa.Column("last_access_time", sa.DateTime(), nullable=False), sa.Column("deleted_at", sa.DateTime()))
op.create_index("uq_asset_references_file_path", "asset_references", ["file_path"], unique=True)
op.create_index("ix_asset_references_asset_id", "asset_references", ["asset_id"])
op.create_index("ix_asset_references_owner_id", "asset_references", ["owner_id"])
op.create_index("ix_asset_references_name", "asset_references", ["name"])
op.create_index("ix_asset_references_is_missing", "asset_references", ["is_missing"])
op.create_index("ix_asset_references_enrichment_level", "asset_references", ["enrichment_level"])
op.create_index("ix_asset_references_created_at", "asset_references", ["created_at"])
op.create_index("ix_asset_references_last_access_time", "asset_references", ["last_access_time"])
op.create_index("ix_asset_references_owner_name", "asset_references", ["owner_id", "name"])
op.create_index("ix_asset_references_deleted_at", "asset_references", ["deleted_at"])
op.create_index("ix_asset_references_preview_id", "asset_references", ["preview_id"])
op.create_table("asset_reference_meta", sa.Column("asset_reference_id", sa.String(36), sa.ForeignKey("asset_references.id", ondelete="CASCADE"), primary_key=True), sa.Column("key", sa.String(256), primary_key=True), sa.Column("ordinal", sa.Integer(), primary_key=True), sa.Column("val_str", sa.String(2048)), sa.Column("val_num", sa.Numeric(38, 10)), sa.Column("val_bool", sa.Boolean()), sa.Column("val_json", sa.JSON()), sa.CheckConstraint("val_str IS NOT NULL OR val_num IS NOT NULL OR val_bool IS NOT NULL OR val_json IS NOT NULL", name="ck_asset_reference_meta_has_value"))
op.create_index("ix_asset_reference_meta_key", "asset_reference_meta", ["key"])
op.create_index("ix_asset_reference_meta_key_val_str", "asset_reference_meta", ["key", "val_str"])
op.create_index("ix_asset_reference_meta_key_val_num", "asset_reference_meta", ["key", "val_num"])
op.create_index("ix_asset_reference_meta_key_val_bool", "asset_reference_meta", ["key", "val_bool"])
op.create_table("asset_reference_tags", sa.Column("asset_reference_id", sa.String(36), sa.ForeignKey("asset_references.id", ondelete="CASCADE"), primary_key=True), sa.Column("tag_name", sa.String(512), sa.ForeignKey("tags.name", ondelete="RESTRICT"), primary_key=True), sa.Column("origin", sa.String(32), nullable=False), sa.Column("added_at", sa.DateTime(), nullable=False))
op.create_index("ix_asset_reference_tags_tag_name", "asset_reference_tags", ["tag_name"])
op.create_index("ix_asset_reference_tags_asset_reference_id", "asset_reference_tags", ["asset_reference_id"])
Loading
Loading