1
0
Fork 0
Commit Graph

448 Commits

Author SHA1 Message Date
Sean Sube e3540ac435
feat(api): add linear blend stage for chain pipeline (#183) 2023-04-10 21:15:57 -05:00
Sean Sube 2eaf85a43e
feat(api): add chain pipeline stages to load images from S3 or URL (#184, #185) 2023-04-10 21:03:19 -05:00
Sean Sube 2a7621c195
feat(api): add params for more SwinIR models 2023-04-10 19:02:12 -05:00
Sean Sube 62aa7e8473
feat(api): add initial support for BSRGAN and SwinIR upscaling (#153, #154) 2023-04-10 17:49:56 -05:00
Sean Sube 464bfd01b8
fix(api): apply FP16 patches to SD upscaling pipeline 2023-04-10 08:37:49 -05:00
Sean Sube 9698e29268
lint(api): name context params consistently (#278) 2023-04-09 20:33:03 -05:00
Sean Sube 1cfc538018
fix(api): ensure spiral grid coords are always whole pixels 2023-04-06 08:52:27 -05:00
Sean Sube c8382dc689
feat(api): implement spiral tile order for non-square images 2023-04-04 20:02:13 -05:00
Sean Sube 0fdf4d3092
implement proper spiral grid coverage 2023-04-03 21:39:17 -05:00
Sean Sube 2c47904057
lint(api): use constant for model filename 2023-03-24 08:14:19 -05:00
Sean Sube a9e55ff9f2
remove references to inversion parameter 2023-03-18 19:47:22 -05:00
Sean Sube f336cc5d02
fix(api): provide noise parameter to SD upscaling (#196) 2023-03-18 14:02:30 -05:00
Sean Sube 226710a015
fix(api): use exception level logs 2023-03-16 22:29:07 -05:00
Sean Sube 6bdaa4a4ed
fix(api): make stage-specific source image optional in GFPGAN stage (#233) 2023-03-10 18:15:31 -06:00
Sean Sube 10fbafaff0
fix(api): correct imports 2023-03-04 22:25:49 -06:00
Sean Sube dbf9eaf1a4
fix(api): run shape inference before converting models to fp16
per discussion in https://github.com/microsoft/onnxruntime/issues/14827
2023-02-28 22:36:45 -06:00
Sean Sube 565873b3ae
test half precision on all diffusion models 2023-02-28 22:23:55 -06:00
Sean Sube 1f9efb433a
apply lint 2023-02-28 22:04:55 -06:00
Sean Sube c99aa67220
name threads, max queues, type/lint fixes 2023-02-28 21:44:52 -06:00
Sean Sube 525ee24e91
track started and finished jobs 2023-02-26 20:09:42 -06:00
Sean Sube 584dddb5d6
lint all the new stuff 2023-02-26 14:15:30 -06:00
Sean Sube 06c74a7a96
feat(api): remove Flask app from global scope 2023-02-26 10:15:12 -06:00
Sean Sube f898de8c54
background workers, logger 2023-02-25 23:49:39 -06:00
Sean Sube 2e7de16778
feat: add a way to select textual inversions 2023-02-25 11:53:32 -06:00
Sean Sube 14c7e6a78c
apply lint 2023-02-21 08:26:09 -06:00
Sean Sube 82016a163a
restore single output in chain pipeline stages 2023-02-21 08:14:04 -06:00
Sean Sube 5f3b84827b
feat(api): add batch size to txt2img and img2img pipelines (#195) 2023-02-20 08:35:18 -06:00
Sean Sube 0deaa8898d
fix(api): add missing params to SD upscale 2023-02-19 23:30:48 -06:00
Sean Sube c1189aad96
feat: add eta parameter (fixes #194) 2023-02-19 23:29:26 -06:00
Sean Sube 40e396a2c4
sonar lint fixes 2023-02-19 22:10:35 -06:00
Sean Sube f561dfae83
fix(api): correct blending mask (fixes #188) 2023-02-19 11:04:11 -06:00
Sean Sube c69e342ee4
apply sonar lint 2023-02-19 07:53:20 -06:00
Sean Sube 30978e3e5b
fix(api): only run GC is devices are passed 2023-02-19 07:41:16 -06:00
Sean Sube b7a780bacc
correct param name for upscale mask 2023-02-18 22:53:57 -06:00
Sean Sube ac1f7449bb
fix(api): use stage source when available 2023-02-18 22:11:44 -06:00
Sean Sube 25c56c7d5c
fix imports 2023-02-18 20:28:21 -06:00
Sean Sube 2b83f942af
restore original LPW names 2023-02-18 18:55:02 -06:00
Sean Sube 4d93c13431
apply lint, fix shadowed names 2023-02-18 17:59:13 -06:00
Sean Sube b4f7973c1e
lint(api): use consistent name for source/mask images to avoid conflict with kwargs 2023-02-18 16:35:57 -06:00
Sean Sube 7b8ced0f68
feat(api): prefer chain stage parameters over request parameters (#138) 2023-02-18 16:27:48 -06:00
Sean Sube ab6462d095
feat(api): enable optimizations for SD pipelines based on env vars (#155) 2023-02-18 11:53:13 -06:00
Sean Sube ecf3c03f0f
feat: add parameter to run correction before upscaling (#132) 2023-02-18 11:04:08 -06:00
Sean Sube b2de114c8c
fix(api): disable progress in diffusers pipelines 2023-02-18 09:42:38 -06:00
Sean Sube b4e66ef502
feat(api): add flag to disable progress bars (#158) 2023-02-18 09:26:13 -06:00
Sean Sube 400e579491
Merge branch 'feat/113-onnx-resrgan' 2023-02-18 09:23:36 -06:00
Sean Sube b3b10b4746
apply lint 2023-02-18 08:46:46 -06:00
Sean Sube 338fc237c7
fix(api): convert Real ESRGAN v3 using same arch as runtime 2023-02-18 08:41:15 -06:00
Sean Sube 3ca02d4875
fix(api): make size params iterable 2023-02-18 05:44:43 -06:00
Sean Sube 0e108daa0f
fix(api): resize images to min dimensions by padding if necessary (#172) 2023-02-18 05:35:53 -06:00
Sean Sube 2c9d96d2ee
feat(api): use ONNX for Real ESRGAN v3 model 2023-02-17 23:25:42 -06:00
Sean Sube 0ed4af18ad
fix(api): run torch gc alongside python (#156) 2023-02-16 18:11:35 -06:00
Sean Sube 8a2a9174ba
fix(api): pass both device and session options to ORT (#38) 2023-02-14 18:57:50 -06:00
Sean Sube d473a0fd2d
fix(api): pass device options to ORT session (#38) 2023-02-14 17:12:52 -06:00
Sean Sube 1289c560bd
apply lint 2023-02-14 00:12:07 -06:00
Sean Sube 05756b2b08
fix(api): patch more download paths (#134) 2023-02-13 22:23:17 -06:00
Sean Sube d1b250660e
fix(api): convert blend sources to the same size as the mask 2023-02-13 21:57:47 -06:00
Sean Sube c432ab0795
remove oldest items from model cache first 2023-02-13 18:33:06 -06:00
Sean Sube 51d53597c0
fix(api): load Real ESRGAN PTH from cache 2023-02-13 18:21:05 -06:00
Sean Sube 0709c1dbf0
feat(api): add GFPGAN and Real ESRGAN to model cache 2023-02-13 18:10:11 -06:00
Sean Sube e9472bc005
feat(api): add model cache for diffusion models 2023-02-13 18:04:46 -06:00
Sean Sube 7fa1783be4
feat: implement blend tab and copy buttons (#62) 2023-02-13 17:34:42 -06:00
Sean Sube 82487f5771
fix(api): separate Real ESRGAN upsampler from GFPGAN stage (#87) 2023-02-12 13:50:28 -06:00
Sean Sube 034be3266e
fix(api): accumulate progress from inpaint pipelines (#90) 2023-02-12 13:16:17 -06:00
Sean Sube 2f6a3afddb
pass progress on to most stages 2023-02-12 12:33:36 -06:00
Sean Sube 06d4f32574
make progress callbacks optional 2023-02-12 12:22:11 -06:00
Sean Sube d9fc908592
feat(api): collect progress from chain pipelines (#90) 2023-02-12 12:17:36 -06:00
Sean Sube 8ea33e9874
fix(api): patch various download fns to use cache (#95) 2023-02-12 06:25:44 -06:00
Sean Sube ffbe0929e6
apply lint 2023-02-11 18:10:36 -06:00
Sean Sube 3a290822eb
feat(api): pass tile order to inpaint and outpaint pipelines 2023-02-11 18:00:18 -06:00
Sean Sube b1a1a2b9c4
lint(api): apply style fixes 2023-02-07 08:20:02 -06:00
Sean Sube b6fd288842
fix(api): calculate outpaint overlap factor before adding margins 2023-02-06 22:49:58 -06:00
Sean Sube a9f4e19616
chore(api): log overlap factor when outpainting 2023-02-06 22:43:58 -06:00
Sean Sube de4a3818a0
fix(api): use SRVGG net for Real ESRGAN v3 2023-02-06 21:36:20 -06:00
Sean Sube ae5cf1fd28
fix(api): restore denoise code path for Real ESRGAN v3 (#109) 2023-02-06 18:11:45 -06:00
Sean Sube 651acf6991
lint recent changes 2023-02-06 17:26:51 -06:00
Sean Sube de4e7b0dc9
feat: add face outscale as its own parameter (#111) 2023-02-06 17:13:37 -06:00
Sean Sube 564cfc1279
lint(api): remove unused upsampler arg 2023-02-06 08:56:34 -06:00
Sean Sube 24ab52bf0d
fix(api): remove background upscaler from GFPGAN stage (#108) 2023-02-06 08:33:36 -06:00
Sean Sube 1dfd9e72ef
fix(api): run background ESRGAN on same device as GFPGAN 2023-02-06 08:10:36 -06:00
Sean Sube c7e0041229
fix(api): pass current device when loading GFPGAN 2023-02-06 08:07:06 -06:00
Sean Sube 811b6640a8
fix(api): only run one form of outpaint tiling 2023-02-05 23:02:06 -06:00
Sean Sube d6c1244d72
fix(api): use grid tiling when inpaint margin is 0 2023-02-05 22:57:52 -06:00
Sean Sube 7462c96616
apply lint fixes again 2023-02-05 17:55:04 -06:00
Sean Sube 20467aafac
chore(api): add logging for LPW pipelines 2023-02-05 17:53:51 -06:00
Sean Sube 9c84d853c9
add missing lpw param 2023-02-05 17:40:10 -06:00
Sean Sube 5f35a2853b
fix(api): fully switch between LPW and regular ONNX pipelines 2023-02-05 17:36:00 -06:00
Sean Sube f3983a7917
fix(api): switch RNG based on LPW parameter 2023-02-05 17:24:15 -06:00
Sean Sube fb376c6b62
feat(api): make LPW an image parameter 2023-02-05 17:15:37 -06:00
Sean Sube 6fe278c744
fix(api): switch between spiral and grid tiling based on outpaint margins (#101) 2023-02-05 16:56:11 -06:00
Sean Sube ca2f0a6404
fix(api): pass outscale factor to CodeFormer (fixes #100) 2023-02-05 16:22:04 -06:00
Sean Sube cb3590720b
lint(api): remove unused imports 2023-02-05 15:33:56 -06:00
Sean Sube 401df84069
fix(api): replace some numpy RNGs with torch equivalent 2023-02-05 13:43:33 -06:00
Sean Sube 7b506cb6d3
feat(api): enable LPW custom pipeline (#27) 2023-02-05 11:31:40 -06:00
Sean Sube 0a9f108156
feat(api): add CodeFormer to automatic upscale 2023-02-05 10:49:20 -06:00
Sean Sube bf1378bf96
fix(api): log stacktrace from job errors 2023-02-05 08:50:26 -06:00
Sean Sube e059f11253
feat(api): add CodeFormer stage for chain pipelines 2023-02-05 08:37:47 -06:00
Sean Sube 35681efc1b
clean up draft CodeFormer stage 2023-02-05 08:06:50 -06:00
Sean Sube 54dd34d211
lint(api): apply black and isort style 2023-02-05 07:53:35 -06:00
Sean Sube 37dd8927bf
fix(api): pass device ID in provider params 2023-02-04 21:52:45 -06:00
Sean Sube cc12cb0fcf
clean up lingering provider refs 2023-02-04 21:23:34 -06:00
Sean Sube 04a2faffd9
fix(api): set CUDA device in ORT session 2023-02-04 21:17:39 -06:00
Sean Sube 8a81e8b810
add missing arg to chain pipeline 2023-02-04 14:27:27 -06:00
Sean Sube ea69753bfd
fix(api): additional logging around model load ops 2023-02-02 23:34:02 -06:00
Sean Sube aff3a3f2ee
lint(api): fix interpolation in some log messages 2023-02-02 18:52:31 -06:00
Sean Sube a1298f1565
fix(api): respect model selection when running inpaint/outpaint stages 2023-02-02 18:51:54 -06:00
Sean Sube 6ce13096ed
feat(api): server setting to select image format 2023-02-02 08:19:57 -06:00
Sean Sube 6697c2eb6a
feat(api): save image params along with image (#81) 2023-02-01 22:20:40 -06:00
Sean Sube 066b1a0230
fix(api): run garbage collection after each model change 2023-02-01 21:20:48 -06:00
Sean Sube c34ddacf55
fix(api): pin outscale for GFPGAN to 1 to avoid sparse tiling 2023-01-31 17:08:30 -06:00
Sean Sube 1ca7edb4a8
fix(api): variable name in GFPGAN 2023-01-31 08:24:10 -06:00
Sean Sube 39f84c4a49
fix(api): convert images to ndarray before passing to GFPGAN 2023-01-31 08:16:57 -06:00
Sean Sube d5e5588939
fix(api): supply missing parameter to GFPGAN 2023-01-30 20:54:39 -06:00
Sean Sube ec1e3614f5
remove unused import 2023-01-29 22:07:51 -06:00
Sean Sube 301cbe8b8c pass provider to upscale pipeline, clean up some debug 2023-01-29 18:54:35 -06:00
Sean Sube bacce0ace9 testing ONNX upscaling 2023-01-29 18:42:05 -06:00
Sean Sube ca613cabe1 more ONNX upscaling 2023-01-29 16:57:18 -06:00
Sean Sube c905fbb728 feat(api): add reduce stages, noise source 2023-01-29 15:23:01 -06:00
Sean Sube f0c905721f fix imports 2023-01-29 11:42:42 -06:00
Sean Sube 483a1bad68 feat(api): use per-tile latents for outpainting 2023-01-29 10:31:22 -06:00
Sean Sube b1ba09af3e fix(api): make sure each pipeline has its own list of stages 2023-01-29 00:25:49 -06:00
Sean Sube 7083505483 fix(api): preserve new pixels after outpainting 2023-01-29 00:16:09 -06:00
Sean Sube 20beff839e fix spiral, override prompt 2023-01-29 00:07:12 -06:00
Sean Sube 6f1ffaa043 fix(api): convert spiral grid coordinates to offsets 2023-01-28 23:58:04 -06:00
Sean Sube a4d3f18a48 feat(api): implement spiral grid for outpainting 2023-01-28 23:46:36 -06:00
Sean Sube 680adc70ea feat(api): save output of each stage in debug mode 2023-01-28 23:08:56 -06:00
Sean Sube 8f1cbc83f8 feat(api): parse named tile sizes 2023-01-28 23:06:25 -06:00
Sean Sube db9189fd3d get upscaling model from stage params 2023-01-28 22:52:39 -06:00
Sean Sube 18803db6ed fix(api): parse border and upscale in chain stages 2023-01-28 22:48:53 -06:00
Sean Sube 151ebff237 feat(api): parse chain pipeline from request 2023-01-28 22:31:34 -06:00
Sean Sube c7a6ec45d8 fix(api): avoid circular deps in diffusion pipeline cache 2023-01-28 20:15:39 -06:00
Sean Sube 3359138a83 clean up logging, use extra args 2023-01-28 17:15:42 -06:00
Sean Sube 4547bcef50 feat(api): switch to python logging 2023-01-28 17:09:19 -06:00
Sean Sube bb3a7dc0e9 log pipeline timing, add common sizes 2023-01-28 14:56:06 -06:00
Sean Sube 8d57d113cd feat(api): add s3 upload chain stage 2023-01-28 12:42:22 -06:00
Sean Sube dcbd059082 feat(api): add img2img and inpaint chain stages 2023-01-28 12:42:02 -06:00
Sean Sube 4188b019a1 test multiple chained upscaling stages 2023-01-28 10:26:04 -06:00
Sean Sube ba3e450d43 fix scale for outpaint 2023-01-28 09:55:47 -06:00
Sean Sube 2c8fec0e53 size outpaint mask correctly 2023-01-28 09:38:25 -06:00
Sean Sube d6193a9a47 fix(api): tile mask during outpaint stage 2023-01-28 09:23:18 -06:00
Sean Sube d89437b11e persist to output dir, do not tile output 2023-01-28 09:15:02 -06:00
Sean Sube 779457b546 feat(api): add save-to-disk stage 2023-01-28 09:08:59 -06:00
Sean Sube ce6cf08684 fix outpaint and txt2img stages 2023-01-28 08:44:24 -06:00
Sean Sube 5119a982db feat(api): synthesize a mask for outpaint stages 2023-01-28 08:37:17 -06:00
Sean Sube 4579e96cc1 feat(api): add inpaint as a chain stage 2023-01-28 08:19:40 -06:00
Sean Sube c7fa50a028 fix cache globals 2023-01-28 00:08:52 -06:00
Sean Sube ee495a8d93 fix(api): correct caching for upscaling models 2023-01-28 00:05:37 -06:00
Sean Sube 56a4acee2a fix(api): split up and cache upscaling and correction stages 2023-01-27 23:28:14 -06:00
Sean Sube caafc9ebc9 lint(api): make modules for chain pipeline and params 2023-01-27 22:48:06 -06:00