diffusers-workflow 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffusers_workflow-0.4.0.dist-info/METADATA +318 -0
- diffusers_workflow-0.4.0.dist-info/RECORD +260 -0
- diffusers_workflow-0.4.0.dist-info/WHEEL +5 -0
- diffusers_workflow-0.4.0.dist-info/entry_points.txt +7 -0
- diffusers_workflow-0.4.0.dist-info/licenses/LICENSE +201 -0
- diffusers_workflow-0.4.0.dist-info/top_level.txt +2 -0
- dw/__init__.py +440 -0
- dw/adapter_compatibility.py +226 -0
- dw/arguments.py +1231 -0
- dw/assessment_rules.py +159 -0
- dw/assets.py +130 -0
- dw/cache_blocks.json +16 -0
- dw/cache_blocks.py +146 -0
- dw/community_pipelines/pipeline_flux_rf_inversion.py +1184 -0
- dw/content_types.py +150 -0
- dw/dissolve_frame_errors.py +121 -0
- dw/docs/ACCELERATION.md +352 -0
- dw/docs/AGENT_LOOP.md +95 -0
- dw/docs/DEPENDENCIES.md +91 -0
- dw/docs/IP_ADAPTER.md +109 -0
- dw/docs/LORAS.md +131 -0
- dw/docs/MCP.md +517 -0
- dw/docs/PROMPT_WEIGHTING.md +78 -0
- dw/docs/QUANTIZATION.md +230 -0
- dw/docs/RECIPES_24GB.md +201 -0
- dw/docs/RELEASING.md +195 -0
- dw/docs/REMOTE.md +140 -0
- dw/docs/REPL_COMMANDS.md +121 -0
- dw/docs/REPL_WORKER_GUIDE.md +51 -0
- dw/docs/SECURITY.md +272 -0
- dw/docs/SECURITY_QUICKREF.md +112 -0
- dw/docs/SERVER.md +679 -0
- dw/docs/TASKS.md +1741 -0
- dw/docs/TESTING.md +71 -0
- dw/docs/WORKFLOW_GUIDE.md +2038 -0
- dw/docs/WORKSPACES.md +316 -0
- dw/download_watch.py +335 -0
- dw/elision.py +306 -0
- dw/events.py +275 -0
- dw/for_each.py +409 -0
- dw/host_memory.py +258 -0
- dw/host_memory_projection.py +230 -0
- dw/hub_cache.py +432 -0
- dw/introspection.py +1228 -0
- dw/kernel_availability.py +208 -0
- dw/locations.py +599 -0
- dw/log_setup.py +45 -0
- dw/loudness.py +82 -0
- dw/media_audio.py +217 -0
- dw/media_frames.py +367 -0
- dw/media_info.py +297 -0
- dw/pipeline_processors/chain.py +821 -0
- dw/pipeline_processors/config_objects.py +237 -0
- dw/pipeline_processors/pipeline.py +2297 -0
- dw/pipeline_processors/remote.py +46 -0
- dw/plan.py +920 -0
- dw/previous_results.py +411 -0
- dw/probe_paths.py +59 -0
- dw/prompt_schema.json +48 -0
- dw/prompt_weighting.py +378 -0
- dw/prompts.py +159 -0
- dw/realize.py +250 -0
- dw/reference_limits.py +215 -0
- dw/reference_names.py +125 -0
- dw/repl.py +338 -0
- dw/repl_commands.py +836 -0
- dw/repl_worker.py +159 -0
- dw/result.py +1720 -0
- dw/result_fps.py +82 -0
- dw/run.py +162 -0
- dw/runs.py +768 -0
- dw/scalar_result_validation.py +97 -0
- dw/schema.py +283 -0
- dw/security.py +1038 -0
- dw/select_validation.py +115 -0
- dw/serve.py +277 -0
- dw/server/__init__.py +2 -0
- dw/server/app.py +4586 -0
- dw/server/assess.py +132 -0
- dw/server/catalog_shape.py +487 -0
- dw/server/enhancers.py +129 -0
- dw/server/exports.py +480 -0
- dw/server/guides.py +257 -0
- dw/server/jobs.py +1561 -0
- dw/server/mcp_mount.py +95 -0
- dw/server/netinfo.py +124 -0
- dw/server/observed_cost.py +379 -0
- dw/server/sysinfo.py +71 -0
- dw/server/ui/assets/abap-08VXUWAP.js +1 -0
- dw/server/ui/assets/apex-BWPQTe0t.js +1 -0
- dw/server/ui/assets/azcli-Bc_sGQ0U.js +1 -0
- dw/server/ui/assets/bat-i0X4ZdIN.js +1 -0
- dw/server/ui/assets/bicep-B5-_aFwp.js +2 -0
- dw/server/ui/assets/cameligo-DMUM7wLl.js +1 -0
- dw/server/ui/assets/clojure-Cm7r79vr.js +1 -0
- dw/server/ui/assets/codicon-Brq4_Ui5.ttf +0 -0
- dw/server/ui/assets/coffee-Ba7i2nA0.js +1 -0
- dw/server/ui/assets/cpp-C7h46wYY.js +1 -0
- dw/server/ui/assets/csharp-BKxtCVv1.js +1 -0
- dw/server/ui/assets/csp-bTuwJoIa.js +1 -0
- dw/server/ui/assets/css-DIMkf-bt.js +3 -0
- dw/server/ui/assets/css.worker-B3ciXF_0.js +93 -0
- dw/server/ui/assets/cssMode-CPznxfY8.js +1 -0
- dw/server/ui/assets/cypher-CVaqCwHa.js +1 -0
- dw/server/ui/assets/dart-onAF5SnQ.js +1 -0
- dw/server/ui/assets/dockerfile-DZFCIeNp.js +1 -0
- dw/server/ui/assets/ecl-D05T4iGw.js +1 -0
- dw/server/ui/assets/editor-jjEx9u7D.css +1 -0
- dw/server/ui/assets/editor.api-CpWcotrd.js +847 -0
- dw/server/ui/assets/editor.worker-q-txB4vs.js +30 -0
- dw/server/ui/assets/elixir-6RTg0lbw.js +1 -0
- dw/server/ui/assets/flow9-C5_-GSwl.js +1 -0
- dw/server/ui/assets/freemarker2-CXtRM8N4.js +3 -0
- dw/server/ui/assets/fsharp-C8Ef5oNN.js +1 -0
- dw/server/ui/assets/go-C-y9NEjX.js +1 -0
- dw/server/ui/assets/graphql-fmXr3nnJ.js +1 -0
- dw/server/ui/assets/handlebars-N7x-6NMY.js +1 -0
- dw/server/ui/assets/hcl-CpzslTdj.js +1 -0
- dw/server/ui/assets/html-PhsdjHSr.js +1 -0
- dw/server/ui/assets/html.worker-C93Ht9o9.js +506 -0
- dw/server/ui/assets/htmlMode-Dgj0SEok.js +1 -0
- dw/server/ui/assets/index-3Vw6WAPW.css +1 -0
- dw/server/ui/assets/index-DgrYhQd9.js +43 -0
- dw/server/ui/assets/ini-sBoK_t0W.js +1 -0
- dw/server/ui/assets/java-BEtHBSE6.js +1 -0
- dw/server/ui/assets/javascript-BJqN9Qhv.js +1 -0
- dw/server/ui/assets/json.worker-B2V3pomh.js +62 -0
- dw/server/ui/assets/jsonMode-DbM4SWSv.js +7 -0
- dw/server/ui/assets/julia-Bri6UV-V.js +1 -0
- dw/server/ui/assets/kotlin-BOotOW0E.js +1 -0
- dw/server/ui/assets/less-B9JPFI3C.js +2 -0
- dw/server/ui/assets/lexon-CfSJPG6W.js +1 -0
- dw/server/ui/assets/liquid-BWr8lEc4.js +1 -0
- dw/server/ui/assets/lspLanguageFeatures-C1iGuDyZ.js +4 -0
- dw/server/ui/assets/lua-CsQS60Ue.js +1 -0
- dw/server/ui/assets/m3-D-oSqn_W.js +1 -0
- dw/server/ui/assets/markdown-Cimd5fb3.js +1 -0
- dw/server/ui/assets/mdx-DAdMi_0p.js +1 -0
- dw/server/ui/assets/mips-CIPQ_RoX.js +1 -0
- dw/server/ui/assets/monaco--ixms01u.css +1 -0
- dw/server/ui/assets/monaco-BGCeEqaw.js +56 -0
- dw/server/ui/assets/msdax-DauUninz.js +1 -0
- dw/server/ui/assets/mysql-SOo6toE5.js +1 -0
- dw/server/ui/assets/objective-c-FvmIjYaQ.js +1 -0
- dw/server/ui/assets/pascal-DrH0SRf2.js +1 -0
- dw/server/ui/assets/pascaligo-D-ptJ9y-.js +1 -0
- dw/server/ui/assets/perl-oz_6vUea.js +1 -0
- dw/server/ui/assets/pgsql-DTj74zXo.js +1 -0
- dw/server/ui/assets/php-nr791fC2.js +1 -0
- dw/server/ui/assets/pla-CopQ2nXW.js +1 -0
- dw/server/ui/assets/postiats-43DmfD33.js +1 -0
- dw/server/ui/assets/powerquery-D3hlyOfw.js +1 -0
- dw/server/ui/assets/powershell-DmHpPYUd.js +1 -0
- dw/server/ui/assets/protobuf-C531GsRP.js +2 -0
- dw/server/ui/assets/pug-Z5eAx3Zn.js +1 -0
- dw/server/ui/assets/python-Bcn70HdC.js +1 -0
- dw/server/ui/assets/qsharp-DkqhCAOL.js +1 -0
- dw/server/ui/assets/r-BwWrilGY.js +1 -0
- dw/server/ui/assets/razor-D1HmNnby.js +1 -0
- dw/server/ui/assets/redis-ClamHrr6.js +1 -0
- dw/server/ui/assets/redshift-DT7zqm-g.js +1 -0
- dw/server/ui/assets/restructuredtext-BYgofb2h.js +1 -0
- dw/server/ui/assets/ruby-DezsRK8O.js +1 -0
- dw/server/ui/assets/rust-DdL9SqIa.js +1 -0
- dw/server/ui/assets/sb-CcwsVR0C.js +1 -0
- dw/server/ui/assets/scala-DHpiXF5c.js +1 -0
- dw/server/ui/assets/scheme-BeGwcela.js +1 -0
- dw/server/ui/assets/scss-gp-XZpBa.js +3 -0
- dw/server/ui/assets/shell-CC2rA5mh.js +1 -0
- dw/server/ui/assets/solidity-BEEn4gHE.js +1 -0
- dw/server/ui/assets/sophia-CRfGWb83.js +1 -0
- dw/server/ui/assets/sparql-D_Lu-MrJ.js +1 -0
- dw/server/ui/assets/sql-NEE52Syq.js +1 -0
- dw/server/ui/assets/st-DbInun42.js +1 -0
- dw/server/ui/assets/swift-Bxkupp3x.js +1 -0
- dw/server/ui/assets/systemverilog-Bz4Y3fRF.js +1 -0
- dw/server/ui/assets/tcl-DISqw1ZD.js +1 -0
- dw/server/ui/assets/ts.worker-D7T1-Ig5.js +67738 -0
- dw/server/ui/assets/tsMode-D6u0XmOW.js +11 -0
- dw/server/ui/assets/twig-De2hgUGE.js +1 -0
- dw/server/ui/assets/typescript-BU6v-LMV.js +1 -0
- dw/server/ui/assets/typespec-B8J7ngcE.js +1 -0
- dw/server/ui/assets/vb-DV3o63ZY.js +1 -0
- dw/server/ui/assets/wgsl-DpFanUEy.js +298 -0
- dw/server/ui/assets/workers-Cn7cTUKr.js +1 -0
- dw/server/ui/assets/xml--0LP2Lwk.js +1 -0
- dw/server/ui/assets/yaml-mpBg9jnt.js +1 -0
- dw/server/ui/index.html +17 -0
- dw/server/updater.py +192 -0
- dw/settings.py +98 -0
- dw/shot_span_preflight.py +116 -0
- dw/shots.py +359 -0
- dw/slice_preflight.py +148 -0
- dw/step.py +187 -0
- dw/step_cache.py +442 -0
- dw/subfolders.py +107 -0
- dw/task_domains.py +307 -0
- dw/tasks/assess.py +826 -0
- dw/tasks/audio_transcription.py +88 -0
- dw/tasks/audio_utils.py +1862 -0
- dw/tasks/background_remover.py +43 -0
- dw/tasks/borders.py +113 -0
- dw/tasks/compose_text.py +74 -0
- dw/tasks/concat_videos.py +300 -0
- dw/tasks/depth_estimator.py +54 -0
- dw/tasks/diffusion_upscale.py +109 -0
- dw/tasks/dissolve_videos.py +342 -0
- dw/tasks/format_messages.py +24 -0
- dw/tasks/gather.py +173 -0
- dw/tasks/grade.py +97 -0
- dw/tasks/image_to_text.py +43 -0
- dw/tasks/image_utils.py +764 -0
- dw/tasks/interpolate_frames.py +252 -0
- dw/tasks/judge.py +68 -0
- dw/tasks/model_cache.py +55 -0
- dw/tasks/pair_audio.py +268 -0
- dw/tasks/qr_code.py +19 -0
- dw/tasks/restore_faces.py +175 -0
- dw/tasks/rife_model.py +192 -0
- dw/tasks/segment.py +121 -0
- dw/tasks/select.py +111 -0
- dw/tasks/speech_generation.py +228 -0
- dw/tasks/stabilize.py +129 -0
- dw/tasks/task.py +920 -0
- dw/tasks/tensor_image.py +57 -0
- dw/tasks/text_generation.py +169 -0
- dw/tasks/text_sections.py +80 -0
- dw/tasks/upscale.py +203 -0
- dw/tasks/video_utils.py +624 -0
- dw/tasks/zoe_depth.py +71 -0
- dw/teacache.py +381 -0
- dw/teacache_models.json +99 -0
- dw/test.py +29 -0
- dw/type_helpers.py +231 -0
- dw/validate.py +68 -0
- dw/variable_constraints.py +444 -0
- dw/variables.py +443 -0
- dw/video_extensions.py +141 -0
- dw/vram_estimate.py +116 -0
- dw/worker.py +764 -0
- dw/workflow.py +2007 -0
- dw/workflow_schema.json +1346 -0
- dw/workflow_sources.py +383 -0
- dw/workflows/h3_context_ir.json +57 -0
- dw/workflows/test.json +31 -0
- dw/workspace.py +730 -0
- dw_mcp/__init__.py +6 -0
- dw_mcp/__main__.py +133 -0
- dw_mcp/assets.py +336 -0
- dw_mcp/authoring.py +114 -0
- dw_mcp/catalog.py +360 -0
- dw_mcp/client.py +486 -0
- dw_mcp/diagnose.py +371 -0
- dw_mcp/exports.py +84 -0
- dw_mcp/guides.py +35 -0
- dw_mcp/media.py +638 -0
- dw_mcp/models.py +97 -0
- dw_mcp/prompts.py +104 -0
- dw_mcp/server.py +1343 -0
- dw_mcp/workspaces.py +212 -0
dw/docs/AGENT_LOOP.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Agent Loop
|
|
2
|
+
|
|
3
|
+
Some of the Issues in this repo are worked by an automated implementer/tester
|
|
4
|
+
agent loop, not a human. It lives in a separate repo
|
|
5
|
+
([`dkackman/iterate`](https://github.com/dkackman/iterate) — private) that
|
|
6
|
+
drives two Claude Code agents in strict alternation against this repo's
|
|
7
|
+
Issues. Nothing about running the loop lives here; this page exists so that
|
|
8
|
+
anyone who opens or comments on one of its Issues — a human, or another
|
|
9
|
+
agent joining in — knows how to act on it correctly.
|
|
10
|
+
|
|
11
|
+
## The two roles
|
|
12
|
+
|
|
13
|
+
- **Implementer** — has this repo checked out and SSH access to the box
|
|
14
|
+
running the MCP server. Reproduces, fixes, deploys, and hands the ticket
|
|
15
|
+
back. Never verifies its own fix.
|
|
16
|
+
- **Tester** — talks to the MCP server only as a protocol client (MCP tool
|
|
17
|
+
calls), no source checkout, no shell/SSH access to the server box. Its job
|
|
18
|
+
is independent verification: it re-runs the original repro over MCP and
|
|
19
|
+
either confirms the fix or bounces the ticket back.
|
|
20
|
+
|
|
21
|
+
That asymmetry — the only role that can mark an issue verified is the one
|
|
22
|
+
with no ability to patch around a bug — is the entire point of the loop. A
|
|
23
|
+
human or third agent joining in should preserve it: don't fix and verify the
|
|
24
|
+
same ticket yourself.
|
|
25
|
+
|
|
26
|
+
A third, standalone **regression agent** periodically runs a growing suite
|
|
27
|
+
of scripted MCP calls (`regression-suite-*.md` in the `iterate` repo) against
|
|
28
|
+
the live server and files/comments on Issues for anything that regresses. It
|
|
29
|
+
doesn't participate in the implementer/tester handoff.
|
|
30
|
+
|
|
31
|
+
## Outside filings
|
|
32
|
+
|
|
33
|
+
The loop runs as one GitHub login (the repo owner's) and must not act
|
|
34
|
+
unattended on text filed by anyone else in this public repo. An issue filed
|
|
35
|
+
under a different login — including a `field-report` from someone else's
|
|
36
|
+
session — is relabelled `owner:don` + `status:needs-approval` before either
|
|
37
|
+
role works it, and is handed to the loop, or not, only after the maintainer
|
|
38
|
+
reviews it.
|
|
39
|
+
|
|
40
|
+
## Reading a ticket
|
|
41
|
+
|
|
42
|
+
Tickets use the **MCP agent-loop ticket** issue template. Two label
|
|
43
|
+
families carry all the state — check both before acting:
|
|
44
|
+
|
|
45
|
+
- **`owner:*`** — exactly one of `owner:implementer` / `owner:tester` /
|
|
46
|
+
`owner:don` at a time: whoever is expected to act on it next. If you're
|
|
47
|
+
not that owner, leave the issue alone beyond reading it (or the specific
|
|
48
|
+
handoff comment/label a role prompt allows).
|
|
49
|
+
- **`status:*`** — where the ticket is in its lifecycle:
|
|
50
|
+
- *(no status label)* — open, ready for the implementer to reproduce.
|
|
51
|
+
- `status:fixed-pending-verify` — implementer has fixed and deployed;
|
|
52
|
+
waiting on the tester to re-run the repro over MCP.
|
|
53
|
+
- `status:verified` — tester confirmed the fix over MCP; issue is closed
|
|
54
|
+
as `completed`.
|
|
55
|
+
- `status:needs-info` — a question bounce; whoever is asked needs to
|
|
56
|
+
answer before work continues.
|
|
57
|
+
- `status:needs-approval` (+ `owner:don`) — parked for the human. The
|
|
58
|
+
implementer uses this for anything beyond a rename-level change
|
|
59
|
+
(engine behavior, breaking syntax). Neither agent touches a parked
|
|
60
|
+
issue.
|
|
61
|
+
|
|
62
|
+
Two built-in GitHub labels close a ticket without a fix:
|
|
63
|
+
|
|
64
|
+
- **`wontfix`** — the implementer's call, with a reason in a comment; issue
|
|
65
|
+
closed as `not planned`. The tester may reopen once with new evidence; a
|
|
66
|
+
second `wontfix` is final.
|
|
67
|
+
- **`duplicate`** — closed as `not planned`, with a comment naming the
|
|
68
|
+
issue it duplicates (`duplicate of #NN`). A closed issue is still
|
|
69
|
+
canonical for duplicate detection — the implementer checks
|
|
70
|
+
`gh issue list --state all` before starting work, not just open issues.
|
|
71
|
+
|
|
72
|
+
`breaking-change` marks an Issue whose fix changed the MCP interface, so the
|
|
73
|
+
tester adjusts its calls instead of filing the change as a new bug.
|
|
74
|
+
|
|
75
|
+
## If you want to participate
|
|
76
|
+
|
|
77
|
+
Whether you're a human or another agent:
|
|
78
|
+
|
|
79
|
+
- Only touch an issue that's currently owned by you (or, for a human, one
|
|
80
|
+
parked with `owner:don`).
|
|
81
|
+
- When you hand a ticket to the next owner, swap the `owner:*` label and
|
|
82
|
+
say what you did in a comment — the next actor has no memory of this
|
|
83
|
+
session, only the issue thread.
|
|
84
|
+
- Keep implementer and tester roles separate. If you're fixing code, don't
|
|
85
|
+
also close the issue as verified — that requires an independent MCP call
|
|
86
|
+
from someone who didn't write the patch.
|
|
87
|
+
- Reference the issue number in any commit that fixes it
|
|
88
|
+
(`fix(mcp): #42 - ...`), and work on a branch merged to `develop`, never
|
|
89
|
+
`master`.
|
|
90
|
+
- Only the tester (or an equivalently independent verifier) closes an issue
|
|
91
|
+
as `completed`/`status:verified`, and only after a real MCP call
|
|
92
|
+
reproduces the fix — not by reading the diff.
|
|
93
|
+
|
|
94
|
+
See the `iterate` repo's `CLAUDE.md` for the full protocol this is
|
|
95
|
+
summarized from, including how the automated loop itself is run.
|
dw/docs/DEPENDENCIES.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
### Linux / macOS (Recommended)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bash ./install.sh
|
|
9
|
+
source ./activate
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Windows
|
|
13
|
+
|
|
14
|
+
```powershell
|
|
15
|
+
.\install.ps1
|
|
16
|
+
.\venv\scripts\activate
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The install scripts handle everything: Python version detection (3.10-3.14), virtual environment creation, PyTorch, diffusers, and all dependencies.
|
|
20
|
+
|
|
21
|
+
### Manual Installation
|
|
22
|
+
|
|
23
|
+
If you prefer manual control:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
python3 -m venv venv
|
|
27
|
+
source venv/bin/activate
|
|
28
|
+
|
|
29
|
+
pip install torch torchvision torchaudio # add --index-url https://download.pytorch.org/whl/cu130 for CUDA on Linux
|
|
30
|
+
pip install -r requirements.txt
|
|
31
|
+
pip install git+https://github.com/huggingface/diffusers
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Where the Dependency List Lives
|
|
35
|
+
|
|
36
|
+
`pyproject.toml` is the single source: its `dependencies` list (plus the
|
|
37
|
+
`server` and `dev` extras) is what the published wheel declares, what
|
|
38
|
+
`requirements.txt` and `requirements-test.txt` resolve (they are one-line
|
|
39
|
+
pointers, `-e .[server]` and `-e .[dev]`), and what the install scripts
|
|
40
|
+
and CI install. To add or change a dependency, edit pyproject.toml -
|
|
41
|
+
every install path picks it up.
|
|
42
|
+
|
|
43
|
+
Things pyproject can't express stay in the scripts: the PyTorch CUDA
|
|
44
|
+
index, diffusers from git HEAD, and the macOS/Windows-specific extras
|
|
45
|
+
below. bitsandbytes carries a `sys_platform == 'linux'` marker in
|
|
46
|
+
pyproject; install.ps1 installs it explicitly on Windows.
|
|
47
|
+
|
|
48
|
+
## Platform-Specific Dependencies
|
|
49
|
+
|
|
50
|
+
**All platforms (core ML):** peft, transformers, accelerate, safetensors, controlnet_aux, sentencepiece, torchsde, torchao, optimum-quanto, gguf, kornia, ftfy, sdnq, spandrel, facexlib (spandrel + facexlib back the `upscale` and `restore_faces` tasks)
|
|
51
|
+
|
|
52
|
+
**All platforms (utilities):** fastapi, uvicorn (the `dw.serve` HTTP server and web UI), av, aiohttp, matplotlib, opencv-python-headless, concurrent-log-handler, qrcode, protobuf, imageio, imageio-ffmpeg, beautifulsoup4, soundfile, jsonschema, black, python-dotenv
|
|
53
|
+
|
|
54
|
+
**Linux (CUDA):** bitsandbytes
|
|
55
|
+
|
|
56
|
+
**Windows (CUDA):** bitsandbytes, kernels
|
|
57
|
+
|
|
58
|
+
**macOS (MPS):** fp4-fp8-for-torch-mps (FP8/FP4 dtype support for Metal), fluidtop
|
|
59
|
+
|
|
60
|
+
## Optional
|
|
61
|
+
|
|
62
|
+
**flash_attn** — Improved attention performance on CUDA. Requires the [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install flash_attn
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**piexif** (installed by default) — Embeds generation metadata as EXIF `UserComment` when a step's `result.embed_metadata` is `true` and the content type is JPEG/WebP (PNG embedding uses Pillow's `PngInfo` and needs nothing extra). Without it, saving falls back to a logged warning and no embedded metadata.
|
|
69
|
+
|
|
70
|
+
## Specifying Python Version
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
export INSTALL_PYTHON_VERSION=3.13
|
|
74
|
+
bash ./install.sh
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Troubleshooting
|
|
78
|
+
|
|
79
|
+
**Hugging Face authentication (401/403 downloading a model):** Most workflows under `workflows/` (Flux, LTX-2, MiniMax...) point at **gated** models on the Hub — repos that require the owner to approve your account before you can download them. A run against one of these fails with an actionable error naming the repo and `huggingface-cli login` (mapped from the Hub's 401/403 in `load_component()`, `dw/pipeline_processors/pipeline.py`) — request access on the model's page (e.g. [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev)) and then log in once, locally:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
huggingface-cli login
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`workflows/templates/text-to-image.json` uses an ungated model and needs no login - start there if you just want to confirm the install works.
|
|
86
|
+
|
|
87
|
+
**Package conflicts:** Re-run the install script — it recreates the venv from scratch.
|
|
88
|
+
|
|
89
|
+
**CUDA not detected:** `install.sh` probes for a working `nvidia-smi` on Linux and installs the CUDA build of torch (cu130) only when it finds one; otherwise (or on a manual install with plain `pip install torch`) you get PyPI's CPU-only Linux wheel. Verify with `python -c "import torch; print(torch.cuda.is_available())"`.
|
|
90
|
+
|
|
91
|
+
**MPS not detected:** Requires Apple Silicon. Verify with `python -c "import torch; print(torch.backends.mps.is_available())"`.
|
dw/docs/IP_ADAPTER.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# IP-Adapter
|
|
2
|
+
|
|
3
|
+
IP-Adapter enables image-prompt conditioning — use a reference image to influence the style or content of generated images alongside a text prompt. It works with any pipeline whose `load_ip_adapter()` diffusers supports — Flux, Stable Diffusion 1.5, SDXL, SD 3.5, and others.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Add an `ip_adapter` block to the pipeline definition and pass `ip_adapter_image` in arguments:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"pipeline": {
|
|
12
|
+
"configuration": {
|
|
13
|
+
"component_type": "FluxPipeline",
|
|
14
|
+
"offload": "sequential"
|
|
15
|
+
},
|
|
16
|
+
"from_pretrained_arguments": {
|
|
17
|
+
"model_name": "black-forest-labs/FLUX.1-dev",
|
|
18
|
+
"torch_dtype": "torch.bfloat16"
|
|
19
|
+
},
|
|
20
|
+
"ip_adapter": {
|
|
21
|
+
"model_name": "XLabs-AI/flux-ip-adapter",
|
|
22
|
+
"weight_name": "ip_adapter.safetensors"
|
|
23
|
+
},
|
|
24
|
+
"arguments": {
|
|
25
|
+
"prompt": "A marmot sits at a counter drinking a milkshake",
|
|
26
|
+
"ip_adapter_image": {
|
|
27
|
+
"location": "https://example.com/reference_style.jpg"
|
|
28
|
+
},
|
|
29
|
+
"num_inference_steps": 25,
|
|
30
|
+
"guidance_scale": 3.5
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Properties
|
|
37
|
+
|
|
38
|
+
| Property | Required | Description |
|
|
39
|
+
| -------- | -------- | ----------- |
|
|
40
|
+
| `model_name` | Yes | HuggingFace Hub repo ID for the IP-Adapter weights |
|
|
41
|
+
| `weight_name` | No | Specific weight file in the repo |
|
|
42
|
+
| `subfolder` | No | Subfolder within the repo |
|
|
43
|
+
| `scale` | No | Adapter strength (default: 1.0). Lower = less influence from reference image |
|
|
44
|
+
|
|
45
|
+
Any other property (e.g. `revision`) is forwarded as-is to the underlying `load_ip_adapter()` call.
|
|
46
|
+
|
|
47
|
+
## Models Without a Built-in Image Encoder
|
|
48
|
+
|
|
49
|
+
Some base models (e.g. Stable Diffusion 3.5) don't ship a default image encoder, so diffusers needs one configured explicitly. Add `image_encoder` and `feature_extractor` components alongside `ip_adapter`, the same way any other pipeline component is configured:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"pipeline": {
|
|
54
|
+
"configuration": { "component_type": "StableDiffusion3Pipeline" },
|
|
55
|
+
"feature_extractor": {
|
|
56
|
+
"configuration": { "component_type": "transformers.SiglipImageProcessor" },
|
|
57
|
+
"from_pretrained_arguments": { "model_name": "google/siglip-so400m-patch14-384" }
|
|
58
|
+
},
|
|
59
|
+
"image_encoder": {
|
|
60
|
+
"configuration": { "component_type": "transformers.SiglipVisionModel" },
|
|
61
|
+
"from_pretrained_arguments": { "model_name": "google/siglip-so400m-patch14-384" }
|
|
62
|
+
},
|
|
63
|
+
"ip_adapter": {
|
|
64
|
+
"model_name": "InstantX/SD3.5-Large-IP-Adapter",
|
|
65
|
+
"weight_name": "ip-adapter.bin",
|
|
66
|
+
"scale": 0.6
|
|
67
|
+
},
|
|
68
|
+
"from_pretrained_arguments": {
|
|
69
|
+
"model_name": "stabilityai/stable-diffusion-3.5-large",
|
|
70
|
+
"torch_dtype": "torch.bfloat16"
|
|
71
|
+
},
|
|
72
|
+
"arguments": {
|
|
73
|
+
"prompt": "a marmot drinks a milkshake",
|
|
74
|
+
"ip_adapter_image": { "location": "https://example.com/reference.jpg" }
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
See [ip-adapter.json](../workflows/templates/ip-adapter.json) for the full workflow.
|
|
81
|
+
|
|
82
|
+
## Image Argument
|
|
83
|
+
|
|
84
|
+
The `ip_adapter_image` uses the standard image loading format:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
"ip_adapter_image": {
|
|
88
|
+
"location": "https://example.com/image.jpg"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
"ip_adapter_image": {
|
|
94
|
+
"location": "./local/reference.png",
|
|
95
|
+
"width": 512,
|
|
96
|
+
"height": 512
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Can also reference a previous step's output:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
"ip_adapter_image": "previous_result:preprocessing_step"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Examples
|
|
107
|
+
|
|
108
|
+
- [ip-adapter.json](../workflows/templates/ip-adapter.json) — Flux with IP-Adapter for style transfer
|
|
109
|
+
- [ip-adapter.json](../workflows/templates/ip-adapter.json) — FLUX.1 dev with an IP-Adapter, and the face-model variant in its description
|
dw/docs/LORAS.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# LoRA Support
|
|
2
|
+
|
|
3
|
+
LoRA (Low-Rank Adaptation) models apply lightweight style or subject modifications to a base model. Add one or more LoRAs to any pipeline step.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"pipeline": {
|
|
10
|
+
"configuration": { "component_type": "FluxPipeline" },
|
|
11
|
+
"from_pretrained_arguments": {
|
|
12
|
+
"model_name": "black-forest-labs/FLUX.1-dev",
|
|
13
|
+
"torch_dtype": "torch.bfloat16"
|
|
14
|
+
},
|
|
15
|
+
"loras": [
|
|
16
|
+
{
|
|
17
|
+
"model_name": "XLabs-AI/flux-RealismLora"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"arguments": {
|
|
21
|
+
"prompt": "a photorealistic landscape"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## LoRA Properties
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
"loras": [
|
|
31
|
+
{
|
|
32
|
+
"model_name": "user/lora-repo",
|
|
33
|
+
"weight_name": "specific_weights.safetensors",
|
|
34
|
+
"subfolder": "lora_subfolder",
|
|
35
|
+
"adapter_name": "my_adapter",
|
|
36
|
+
"scale": 0.8
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Property | Required | Description |
|
|
42
|
+
| -------- | -------- | ----------- |
|
|
43
|
+
| `model_name` | Yes | HuggingFace Hub repo ID |
|
|
44
|
+
| `weight_name` | No | Specific weight file in the repo |
|
|
45
|
+
| `subfolder` | No | Subfolder within the repo |
|
|
46
|
+
| `adapter_name` | No | Named identifier for the adapter. Defaults to the LoRA's position in the list (`"0"`, `"1"`, ...) if omitted |
|
|
47
|
+
| `scale` | No | Blend strength (default: 1.0). Lower = less effect |
|
|
48
|
+
|
|
49
|
+
Any other property (e.g. `revision`) is forwarded as-is to the underlying `load_lora_weights()` call.
|
|
50
|
+
|
|
51
|
+
## Multiple LoRAs
|
|
52
|
+
|
|
53
|
+
Stack multiple LoRAs. They are blended via weighted adapter composition:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
"loras": [
|
|
57
|
+
{
|
|
58
|
+
"model_name": "XLabs-AI/flux-RealismLora",
|
|
59
|
+
"adapter_name": "realism",
|
|
60
|
+
"scale": 0.7
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"model_name": "user/style-lora",
|
|
64
|
+
"adapter_name": "style",
|
|
65
|
+
"scale": 0.5
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## LoRA with Quantization
|
|
71
|
+
|
|
72
|
+
LoRAs work with quantized models:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"pipeline": {
|
|
77
|
+
"transformer": {
|
|
78
|
+
"configuration": { "component_type": "SD3Transformer2DModel" },
|
|
79
|
+
"quantization_config": {
|
|
80
|
+
"configuration": { "config_type": "BitsAndBytesConfig" },
|
|
81
|
+
"arguments": { "load_in_4bit": true, "bnb_4bit_quant_type": "{nf4}" }
|
|
82
|
+
},
|
|
83
|
+
"from_pretrained_arguments": {
|
|
84
|
+
"model_name": "stabilityai/stable-diffusion-3.5-large",
|
|
85
|
+
"subfolder": "transformer",
|
|
86
|
+
"torch_dtype": "torch.bfloat16"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"configuration": { "component_type": "StableDiffusion3Pipeline" },
|
|
90
|
+
"from_pretrained_arguments": {
|
|
91
|
+
"model_name": "stabilityai/stable-diffusion-3.5-large",
|
|
92
|
+
"torch_dtype": "torch.bfloat16"
|
|
93
|
+
},
|
|
94
|
+
"loras": [
|
|
95
|
+
{
|
|
96
|
+
"model_name": "crystalwizard/cubic-abstract-1",
|
|
97
|
+
"weight_name": "cubic-abstract-lora.safetensors"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"arguments": { "prompt": "cubart a leaf" }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Variable LoRA
|
|
106
|
+
|
|
107
|
+
Make the LoRA configurable via workflow variables:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"variables": {
|
|
112
|
+
"lora": "XLabs-AI/flux-RealismLora"
|
|
113
|
+
},
|
|
114
|
+
"steps": [{
|
|
115
|
+
"pipeline": {
|
|
116
|
+
"loras": [{ "model_name": "variable:lora" }],
|
|
117
|
+
"arguments": { "prompt": "variable:prompt" }
|
|
118
|
+
}
|
|
119
|
+
}]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
python -m dw.run workflow.json lora="other-user/other-lora"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Examples
|
|
128
|
+
|
|
129
|
+
- [lora.json](../workflows/templates/lora.json) — Flux with realism LoRA and variables
|
|
130
|
+
- [lora.json](../workflows/templates/lora.json) — SD 3.5 with yarn art style LoRA
|
|
131
|
+
- [lora.json](../workflows/templates/lora.json) — A LoRA adapter on FLUX.1 dev, with the SD 3.5 variant in its description
|