Commit Graph

159 Commits

Author SHA1 Message Date
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