Commit Graph

214 Commits

Author SHA1 Message Date
altryne
beed3de337
UI fix for having to select which image you want to do the action on - (#166)
* Simplified the UI, using JS, removing the need for image select input

Signed-off-by: Alex Volkov <alex.volkov@fundbox.com>

* Merging incoming changes before PR

Signed-off-by: Alex Volkov <alex.volkov@fundbox.com>

* Removing pychache

Signed-off-by: Alex Volkov <alex.volkov@fundbox.com>

* adding gitignore

Signed-off-by: Alex Volkov <alex.volkov@fundbox.com>

Signed-off-by: Alex Volkov <alex.volkov@fundbox.com>
2022-08-28 01:28:21 +01:00
hlky
a498c272b9
Fix #159 2022-08-28 01:25:28 +01:00
hlky
3c2be10770
Revert "added gobig configuration sliders (#164)"
This reverts commit 24f444dbcb.
2022-08-28 01:24:17 +01:00
devilismyfriend
24f444dbcb
added gobig configuration sliders (#164)
* added go big implementation

* removed useless comments

removed useless comments

* added gobig configuration sliders

* return proper image for tab

* fixed file naming issues from go big tab

* resolved conflicts

Co-authored-by: dr3amer <91037083+dr3am37@users.noreply.github.com>
2022-08-28 00:44:06 +01:00
hlky
82616d12a0
#125 2022-08-28 00:41:22 +01:00
hlky
f19029aa6b
#158
Fixed

At most should produce 2 samples
>original & gfpgan
>original & esrgan
>original & gfpgan -> esrgan

Turn off save individual samples to save only gfpgan, esrgan or gfpgan -> esrgan
2022-08-27 23:26:42 +01:00
Torbjörn Lönnemark
dac090625b Use white text for alternate text matrix
The previous color magenta (255, 0, 255) distracts from the actual
images. Use white instead.

The text already has black stroke, so it remains readable even on white
backgrounds.
2022-08-27 21:56:49 +01:00
Torbjörn Lönnemark
ceecb1a33d Fix duplicates
This was another regression caused by
82770bacae.

Fixes #147. Fixes #148.
2022-08-27 21:56:34 +01:00
PrinzKasper
a3456f9992
Minor Fixes to the recent UI restyling (#154)
* Fix minor things from last big UI restyle

These two changes were applied to txt2img tab but not img2img tab:

Sample select changed from Radio to Dropdown,
Seed Input restricted to single line, which also removes the resize handlebar

Added a small CSS Workaround for a gradio bug in firefox: The Seed output box is a disabled number field, in chromium gradio will hide the up/down arrows but on firefox it leaves a weird grey square, the CSS rule included in this commit fixes that issue.

* remove full_width from where it doesn't belong

Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
2022-08-27 21:38:52 +01:00
dr3amer
e1cc092ba9 removed useless comments
removed useless comments
2022-08-27 21:09:49 +01:00
dr3amer
eb6f513fdf added go big implementation 2022-08-27 21:09:49 +01:00
Torbjörn Lönnemark
93412100a6 Revert bad fix for #112
The negative filename reported in #112 was caused by the old (now
replaced) listdir-based sequence number calculation, that incorrectly
subtracted 1 from the number of files already in the directory:

    base_count = len([x for x in os.listdir(sample_path_i) if x.endswith(('.png', '.jpg'))]) - 1 # start at 0

The `- 1` was probably copied from the code for the base directory,
which had to subtract 1 to account for the `samples/` subdirectory (that
was before the listdir code started checking file extensions).

The get_next_sequence_number could never return negative numbers, since
it returns `result + 1`, meaning the sequence starts at 0 as intended.
2022-08-27 19:16:53 +01:00
hlky
10f8f4c078
Fixes #112 #125 2022-08-27 18:51:56 +01:00
Torbjörn Lönnemark
446d18f94c Use get_next_sequence_number everywhere
This got lost at some point for seemingly no reason, so restore it.
2022-08-27 18:37:58 +01:00
Torbjörn Lönnemark
fe6f1e3dc5 Fix regular prompt matrix
Commit 82770bacae broke regular prompt
matrix, causing the following error:

    Traceback (most recent call last):
      File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/gradio/routes.py", line 247, in run_predict
        output = await app.blocks.process_api(
      File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/gradio/blocks.py", line 641, in process_api
        predictions, duration = await self.call_function(fn_index, processed_input)
      File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/gradio/blocks.py", line 556, in call_function
        prediction = await anyio.to_thread.run_sync(
      File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
        return await get_asynclib().run_sync_in_worker_thread(
      File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
        return await future
      File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
        result = context.run(func, *args)
      File "scripts/webui.py", line 933, in txt2img
        output_images, seed, info, stats = process_images(
      File "scripts/webui.py", line 841, in process_images
        grid = image_grid(output_images, batch_size, force_n_rows=1 << ((len(prompt_matrix_parts)-1)//2), captions=prompt_matrix_parts)
      File "scripts/webui.py", line 384, in image_grid
        size = d.textbbox( (0,0), captions[i], font=fnt, stroke_width=2, align="center" )
    IndexError: list index out of range
2022-08-27 18:31:16 +01:00
Torbjörn Lönnemark
145102950a Extract font loading into function and use everywhere
Fixes font loading on linux (again).
2022-08-27 18:31:04 +01:00
hdon1
d89c381f69 Steps in sample filename
Include steps before the sampler name in sample filename to make easier quick reference.
2022-08-27 18:28:47 +01:00
hdon1
7859bc9205 Update webui.py 2022-08-27 18:28:47 +01:00
hdon1
c861b71d95 Prevent overwriting with different sampler
Include sampler name in image filename to prevent overwriting when same seed is used
2022-08-27 18:28:47 +01:00
JohannesGaessler
fba80c4484 Allow unicode in YAML info dicts 2022-08-27 17:56:18 +01:00
Oxlamon
82770bacae Add simple templating 2022-08-27 16:38:50 +01:00
EyeDeck
54a24088aa
fix debug (#126)
* Expose some useful Gradio server launch arguments to command line

* add --grid-format, --gradio-share args

* fixes, add --gradio-disable-queue

* space

* remove debug oops
2022-08-27 16:38:19 +01:00
EyeDeck
b2dc4539d4
Added --grid-format command-line arg (#123)
* Expose some useful Gradio server launch arguments to command line

* add --grid-format, --gradio-share args

* fixes, add --gradio-disable-queue

* space
2022-08-27 14:28:10 +01:00
hlky
a91d2af413 Update webui.py
Co-authored-by: PrinzKasper <jan.schaufelberger@viadukt4.de>
2022-08-27 13:55:57 +01:00
hlky
08e95348d6 Update webui.py
Co-authored-by: PrinzKasper <jan.schaufelberger@viadukt4.de>
2022-08-27 13:55:57 +01:00
hlky
1b341dd84c Update webui.py
Co-authored-by: PrinzKasper <jan.schaufelberger@viadukt4.de>
2022-08-27 13:55:57 +01:00
altryne
cb0953c312 Adding 2 options, --share and --share-password, to share online with gradio
Signed-off-by: altryne <altryne@gmail.com>
2022-08-27 13:55:57 +01:00
altryne
aec6308035 Ok now css is fixed
Signed-off-by: altryne <altryne@gmail.com>
2022-08-27 13:55:57 +01:00
altryne
3fbc950cd6 FIxed css to have the center column take most of the space
Signed-off-by: altryne <altryne@gmail.com>
2022-08-27 13:55:57 +01:00
altryne
bfe6d32d42 Typo in styleing
Signed-off-by: altryne <altryne@gmail.com>
2022-08-27 13:55:57 +01:00
Alex Volkov
98d87b8842 Fixed auto selecting of the img2img tab with gr.Update
Signed-off-by: Alex Volkov <alex.volkov@fundbox.com>
2022-08-27 13:55:57 +01:00
Alex Volkov
43889682c6 Working on reslying the UI
Signed-off-by: Alex Volkov <alex.volkov@fundbox.com>
2022-08-27 13:55:57 +01:00
JohannesGaessler
55487bc60c Basic scripting support, CLI batch processing 2022-08-27 13:38:12 +01:00
hlky
b9b74329ae
Save original copy of image before upscaling or face fixing #103 2022-08-27 05:54:59 +01:00
Torbjörn Lönnemark
343b4157d4 Improve sequence number generation
This should behave much better, for example if (re)moving older files
from the output directories.

Also remove the increments (which never had any effect), and move the
grid_count calculation right before where it's used.
2022-08-27 05:06:46 +01:00
hlky
7613b17d59
fix img2img ValueError: negative shift count 2022-08-27 04:56:39 +01:00
Torbjörn Lönnemark
4ac26312ff Default --gpu to value of $CUDA_VISIBLE_DEVICES if set
Trust the value of $CUDA_VISIBLE_DEVICES if it is already set and --gpu
is not passed.
2022-08-27 04:41:03 +01:00
hlky
1d622b2120
Prompt matrix fix 2022-08-27 04:39:00 +01:00
hlky
34a0611e9c
NameError undefined '_' 2022-08-27 03:43:41 +01:00
hlky
670ab25a6a Fix again, final hopefully 2022-08-27 03:39:14 +01:00
hlky
bc212870ae Fix conflicts 2022-08-27 03:39:14 +01:00
hlky
ddc1f428e8 Conflicts 2022-08-27 03:39:14 +01:00
hlky
b0b9c8a1d9 Optimized support force push 2022-08-27 03:39:14 +01:00
oldfndm
0aa9727f6c feat(): add mask blur strength slider 2022-08-27 00:53:36 +01:00
hlky
78d136e9f2
glob functionality using listdir 🔥 2022-08-27 00:52:56 +01:00
Torbjörn Lönnemark
6d5ac72790 Fix seed conversion
Max value for a 32bit unsigned int is 2**32 - 1, not 2**32 (and the
range of possible values returned by randint includes both of its
arguments).

Python's hash() function is not deterministic across different
invocations of the interpreter. This meant a given string seed would
produce different results after restarting the script. Use the passed
strings to seed a Random instance instead.
2022-08-27 00:19:41 +01:00
oldfndm
ab9f89a585 feat(): add advanced editor 2022-08-27 00:08:15 +01:00
hlky
d310ca68b9 CPU support for RealESRGAN/GFPGAN 💻
Also, a new way to set gpu device for RealESRGAN/GFPGAN

Usage:
--extra-models-cpu
or a combination of
--gfpgan-cpu and --esrgan-cpu
2022-08-26 22:44:57 +01:00
hlky
ee5537d8f4 GFPGAN/RealESRGAN CPU support
Test on this branch for now until I add a cli argument
Tested working on my machine, RealESRGAN ran on CPU, result attached to #81
2022-08-26 22:44:57 +01:00
Craftyawesome
d973e5c6d1 Use GC before GAN 2022-08-26 22:17:24 +01:00
hlky
a7fa62bbfe Revert to os.listdir() 2022-08-26 21:49:08 +01:00
Steve Stavropoulos
1f4a0eb310 Make --gpu argument use the correct GPU 2022-08-26 21:41:19 +01:00
hlky
51edb7259e Possible fix 2022-08-26 21:41:19 +01:00
hlky
e655d4f58f
🔴 💚 2022-08-26 20:35:26 +01:00
hlky
0b6811464a
stderr + part of flagging got deleted?? 2022-08-26 20:33:13 +01:00
hlky
87f8712f53
defaults 2022-08-26 20:29:26 +01:00
hlky
7b44c49680
fix conflicts 2022-08-26 20:26:10 +01:00
hlky
18415d704f
Revert "Merge branch 'master' into patch-1"
This reverts commit f13f810af7, reversing
changes made to 4f8dd02ccb.
2022-08-26 20:22:25 +01:00
hlky
f13f810af7
Merge branch 'master' into patch-1 2022-08-26 20:20:57 +01:00
JohannesGaessler
a167ac9860 Fixed setting environmental variable on Linux 2022-08-26 20:18:28 +01:00
Georg Zoeller
4f8dd02ccb
Adding .png metadata
This may open the option to read data from images dragged into the tool later.  Activated with --save_metadata

Properties (example output from imagemagic 'identify -verbose' command:
    SD:cfg_scale: 7.5
    SD:GFPGAN: False
    SD:height: 512
    SD:normalize_prompt_weights: True
    SD:prompt: a beautiful matte painting of a cottage on a magical fantasy island, unreal engine, barometric projection, rectilinear
    SD:seed: 247624793
    SD:steps: 50
    SD:width: 512
2022-08-27 03:08:15 +08:00
hlky
187c77e9c7 force GFPGAN/RealESRGAN to selected gpu 2022-08-26 19:58:01 +01:00
_nderscore
63f16a2b25 fix: prevent memory monitoring from breaking on non-nvidia gpus 2022-08-26 19:58:01 +01:00
_nderscore
a8bf8941b1 feat: add --gpu argument for users with multiple gpus 2022-08-26 19:58:01 +01:00
JohannesGaessler
33eac66a85 Fixed config values not being applied 2022-08-26 19:38:11 +01:00
JohannesGaessler
cab0681bb5 Working glob pattern for counting png files 2022-08-26 16:49:58 +01:00
hlky
f5228aadf6
jpg samples 🔥
#15 implemented
2022-08-26 16:38:24 +01:00
oldfndm
46d6740f02 fix(): fix mask errors when sending 2022-08-26 15:30:11 +01:00
hlky
ec43d18ee5
fix pr 🐸 2022-08-26 15:14:40 +01:00
JohannesGaessler
b57d2bc3c9 separate output directories, sample info files 2022-08-26 15:11:34 +02:00
hlky
1d4ece76b8
Disable telemetry + add title
#62 implemented
2022-08-26 13:12:08 +01:00
hlky
d184f373fc
Merge branch 'master' into 55-realesrgan-support 2022-08-26 11:47:20 +01:00
chanoc
164b318fb4 Update copy-paste generation parameters to reflect RealESRGAN usage
Fix minor error in README
2022-08-26 03:02:04 -07:00
chanoc
601b176a18 Add support for RealESRGAN upscaling 2022-08-26 02:37:35 -07:00
Sam Green
844311fe7b Add support for configuring defaults. 2022-08-26 04:28:36 +01:00
oldfndm
524bdfe731 feat(): add copy to img2img 2022-08-25 22:49:23 -04:00
oldfndm
73d5588723 fix(): fix error when generating from crop mode 2022-08-25 21:59:54 -04:00
oldfndm
7eea0a2906 fix whitespace 2022-08-25 21:36:39 -04:00
oldfndm
2171399708 feat(): copy output image to input 2022-08-25 21:18:50 -04:00
oldfndm
f12de25a58 feat(): add cropping 2022-08-25 21:18:48 -04:00
oldfndm
3f7864115f feat(): migrate from interface to blocks 2022-08-25 21:16:35 -04:00
hlky
92bb0c7fb0
🔥 Random loopback seed Merge pull request #39 from hlky/32-loopback-should-have-the-option-to-randomize-seed
🔥 Random loopback seed   #32 implemented
2022-08-26 00:06:03 +01:00
Torbjörn Lönnemark
0d6e2ae144 Fix font loading on linux
If loading Arial fails, try loading a font commonly installed on Linux
distros.

This means it continues to work on Windows, and will also just work on
most Linux machines (DejaVu Sans is widely available and often installed
by default).
2022-08-26 00:10:49 +02:00
hlky
1879e76be1
Update webui.py 2022-08-25 22:55:00 +01:00
hlky
9c780e1d18
Fix #36 📓 2022-08-25 22:52:06 +01:00
oldfndm
f3ea97ddbc feat(): force bigger image input box 2022-08-25 17:42:42 -04:00
hlky
e62ef1bb67
Loopback random seed 2022-08-25 22:07:23 +01:00
hlky
770ead14f0
Possible fix 2022-08-25 17:59:57 +01:00
hlky
f0287a33d2
🔥 Scripting support for txt2img 🔥 - Merge pull request #22 from JohannesGaessler/scripting
🔥 Scripting support for txt2img 🔥
2022-08-25 14:58:29 +01:00
EyeDeck
f63b294b87 add missing selfs 2022-08-25 08:31:44 -04:00
JohannesGaessler
0d133e05f4 Scripting support for txt2img 2022-08-25 14:20:29 +02:00
EyeDeck
5e9ed5961d Workaround for Gradio server hanging on keyboard interrupt
Moved the demo.launch() call to start up a new thread, so we can kill the process ourselves on keyboard interrupt
2022-08-25 08:08:24 -04:00
hlky
2b264de644
Update webui.py 2022-08-25 11:40:01 +01:00
EyeDeck
67130cf1ff Update webui.py 2022-08-25 04:12:10 -04:00
EyeDeck
60cd83aa03 Fix crash when cfg_scale == 1.0 2022-08-25 02:28:01 -04:00
EyeDeck
13c818053a Update webui.py
the same commit I made last time
2022-08-25 01:47:01 -04:00
hlky
c2ccff1684
🐸 work WITHOUT a mask
keep_mask default should be FALSE
🐸
2022-08-25 06:06:54 +01:00
hlky
e34c6a8b7e
,,,,,, 🐸 👎 2022-08-25 06:01:15 +01:00
hlky
58f11b34e8
🐸 🐸 🐸 2022-08-25 05:52:17 +01:00
hlky
2f2d78956f
Revert "Revert "Update webui.py""
This reverts commit 9c7af7a3d0.
2022-08-25 05:44:53 +01:00