Giter Site home page Giter Site logo

onebuttonprompt's People

Contributors

abdullahalfaraj avatar airjen avatar haohaocreates avatar kex0 avatar kuriot avatar lanice avatar ltdrdata avatar nemilya avatar pazz89 avatar virusshell avatar wall-e avatar xidus90 avatar xingren23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onebuttonprompt's Issues

A way to remove known characters

I would like the prompt to never generate known fictional or non-fictional characters. Should I just blank out the CSVs? or replace them with random names? I don't see an option to avoid them in the settings.

Amazing script by the way. Thank you so much for making it.

Windows Paths wrong

When I run the script, it seems to process all paths in a wrong manner.

e.g. Instead of E:\ImageAI\models\protogenX53OfficialR_10.safetensor it only looks for E:ImageAImodelsprotogenX53OfficialR_10

Same with VAEs and Upscalers

Error when using Start generating but only upscale in One Button Run and Upscale.

Hello,

First, thank's so much for you work !!

however I have a problem with One button run and upscale (am on A1111) i wan't to only upscale but the script encounters this error:

Traceback (most recent call last):
File "E:\Dev\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "E:\Dev\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api
result = await self.call_function(
File "E:\Dev\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
File "E:\Dev\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "E:\Dev\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "E:\Dev\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "E:\Dev\stable-diffusion-webui\extensions\OneButtonPrompt\main.py", line 227, in generateimages
if(img2imgactivate == False or continuewithnextpart == False): # If we dont want to run, turn it off
UnboundLocalError: local variable 'continuewithnextpart' referenced before assignment

Bug: textual version not processed

If you add textual inversion in "add after" or "add before" textbox, is used like a normal text and not used as textual inversion.
Also it is ignored in the chosen style.

chanceroll is not defined

getting the following error when trying to generate landscapes:
edit1: seems chanceroll should be chance_roll
edit2: yep, changing chanceroll to chance_roll fixes it

Starting generating the prompt
*** Error completing request
*** Arguments: ('task(f1dlimqonzxqmbf)', '', '', [], 20, 13, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 768, False, 0.4, 2, 'Latent', 20, 0, 0, 0, '', '', [], 7, False, {'ad_model': 'face_yolov8n.pt', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 2048, 128, True, True, True, False, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, 7, 100, 'Constant', 0, 'Constant', 0, 4, False, 1.6, 0.97, 0.4, 0, 20, 0, 12, '', True, False, False, False, 512, False, True, ['Face'], False, '{\n "face_detector": "RetinaFace",\n "rules": {\n "then": {\n "face_processor": "img2img",\n "mask_generator": {\n "name": "BiSeNet",\n
"params": {\n "fallback_ratio": 0.2\n }\n }\n }\n }\n}', 'None', <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x00000224B6AF8E80>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002268DFC5270>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x00000224B6AFBF70>, False, False, 'Matrix', 'Horizontal', 'Mask', 'Prompt', '1,1', '0.2', False, False, False, 'Attention', False, '0', '0', '0.4', None, False, 0.75, 1, True, 0.3, 'Latent', 0.55, 0.3, 0.2, 0.2, [], False, 1.5, 1.2, False, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False, False, False, '#000000', False, '', '', '', '', '', '', None, 1.0, 1, 7, 'landscape', 'baroque', 'painting', '', '', '', '1', 'none', False, '', '', 'comma', '', False, '', 4, 'all', 'all', 'all', 'all', 1.6, 0.97, 0.4, 0, 20, 0, 12, '', True, False, False, False, 512, False, True, ['Face'], False, '{\n "face_detector": "RetinaFace",\n "rules": {\n "then": {\n "face_processor": "img2img",\n "mask_generator": {\n "name": "BiSeNet",\n "params": {\n "fallback_ratio": 0.2\n }\n }\n }\n }\n}', 'None', None, None, False, None, None, False, None, None, False, 50) {}
Traceback (most recent call last):
File "C:\Programme - Extra\StableDiffusion\stable-diffusion-webui\modules\call_queue.py", line 55, in f
res = list(func(*args, **kwargs))
File "C:\Programme - Extra\StableDiffusion\stable-diffusion-webui\modules\call_queue.py", line 35, in f
res = func(*args, **kwargs)
File "C:\Programme - Extra\StableDiffusion\stable-diffusion-webui\modules\txt2img.py", line 54, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "C:\Programme - Extra\StableDiffusion\stable-diffusion-webui\modules\scripts.py", line 456, in run
processed = script.run(p, *script_args)
File "C:\Programme - Extra\StableDiffusion\stable-diffusion-webui\extensions\OneButtonPrompt\scripts\onebuttonprompt.py", line 1000, in run
preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring, prefixprompt, suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance,chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept)
File "C:\Programme - Extra\StableDiffusion\stable-diffusion-webui\extensions\OneButtonPrompt\build_dynamic_prompt.py", line 1415, in build_dynamic_prompt
if(chanceroll(insanitylevel, subjectlandscapeaddonlocationchance)):
NameError: name 'chanceroll' is not defined


Automatic 1111 freeze

Hello, I just found a situation where your extension crashes automatic 1111.
I gave external access to a friend via internet (myip:7860) with the --listen --share startup options in web-ui.bat.
Unfortunately, when me and my friend use your extension at the same time it crashes automatic 1111 which freezes completely.
If we use it separately, everything goes well with your extension which is wonderful.
Thx for your great work.

Please do not force the formatting

image

I need this format in my prompt words:
AAA,BBB[xxx<LoRA_A>:yyy<LoRA_B>:0.3],zzz<LoRA:C>//////,
But it will be forced to adjust to:
AAA,BBB[xxx:yyy:0.3],zzz//////, ***<LoRA_A> <LoRA_B> <LoRA:C>

There is another situation, for example:
[<AAA,<LoRA:A>>:<BBB,CCC>:0.5],
will become:
[>::0.5], ***, <AAA,<LoRA:A> <BBB,CCC>

or:
[AAA,<LoRA:A>:BBB,CCC:0.5],
will become:
[AAA:BBB,CCC:0.5], ***, <LoRA:A>

GradioUnusedKwargWarning

Hello. I think you are aware of this little thing, but when installing the extension on the latest version of AUTOMATIC1111, the following warnings appear:

...
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.0-2-g4afaaf8a
...
D:\AI\NS\modules\gradio_extensons.py:50: GradioUnusedKwargWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 1}
res = original_BlockContext_init(self, *args, **kwargs)
create ui: done in 0.755s
...

I even tried installing on a clean version of the repository. Of the third-party extensions, specifically left only this one. I hope you fix it. Thank you.

Call Tiled Diffusion & VAE for upscale

First of all this is a great extension, thank you for making it. It has helped me so much.

It is a great idea to be able to call Ultimate SD Upscale for one-click batch upscale. On top of that, I would like to see this feature further enhanced.
While Ultimate SD Upscale is a great extension, it still has its advantages and disadvantages compared to Tiled Diffusion & VAE.
For me and some other users, we are more accustomed to using Tiled Diffusion & VAE. And in my experience, it handles some details better than Tiled Diffusion & VAE.
Therefore, I think including Tiled Diffusion & VAE as one of the upscale options is a very good enhancement to OneButtonPrompt.

Tiled Diffusion & VAE: https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111

NanException when using the Run and Upscale page

Hi,
I had this issus while using the Run and Upscale tab.
Generated 1st image fine, and then hit this on the second attempt.

My settings and console output in screenshots: https://imgur.com/a/24tyw81

Please have a look.

Thank you.

`│ E:\Repo\stable-diffusion-webui\modules\devices.py:158 in test_for_nans │
│ │
│ 157 │ │
│ ❱ 158 │ raise NansException(message) │
│ 159 │
│ │
│ ╭───────────────────────────────────────────── locals ─────────────────────────────────────────────╮ │
│ │ message = "A tensor with all NaNs was produced in Unet. This could be either because there'"+324 │ │
│ │ shared = <module 'modules.shared' from 'E:\Repo\stable-diffusion-webui\modules\shared.py'> │ │
│ │ where = 'unet' │ │
│ │ x = tensor([[[[nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ ..., │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan]], │ │
│ │ │ │ │ │
│ │ │ │ [[nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ ..., │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan]], │ │
│ │ │ │ │ │
│ │ │ │ [[nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ ..., │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan]], │ │
│ │ │ │ │ │
│ │ │ │ [[nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ ..., │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan]]], │ │
│ │ │ │ │ │
│ │ │ │ │ │
│ │ │ │ [[[nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ ..., │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan]], │ │
│ │ │ │ │ │
│ │ │ │ [[nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ ..., │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan]], │ │
│ │ │ │ │ │
│ │ │ │ [[nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ ..., │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan]], │ │
│ │ │ │ │ │
│ │ │ │ [[nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ ..., │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan], │ │
│ │ │ │ [nan, nan, nan, ..., nan, nan, nan]]]], device='cuda:0') │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video
card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline
argument to fix this. Use --disable-nan-check commandline argument to disable this check.
If this keeps happening: Is WebUI started with --api enabled?

Traceback (most recent call last):
File "E:\Repo\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "E:\Repo\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api
result = await self.call_function(
File "E:\Repo\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
File "E:\Repo\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "E:\Repo\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "E:\Repo\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "E:\Repo\stable-diffusion-webui\extensions\OneButtonPrompt\main.py", line 140, in generateimages
txt2img = call_txt2img(randomprompt, size ,hiresfix, 0, filenamecomplete,model ,samplingsteps,cfg, hiressteps, denoisestrength,samplingmethod, upscaler,hiresscale,apiurl,qualitygate,quality,runs,negativeprompt)
File "E:\Repo\stable-diffusion-webui\extensions\OneButtonPrompt\call_txt2img.py", line 149, in call_txt2img
raise ValueError("API has not been responding after several retries. Stopped processing.")
ValueError: API has not been responding after several retries. Stopped processing.
`

Error upon generating

I just updated the extension but when trying to do a blank generation, nothing changed or added then I get the following error.

Starting generating the prompt
Error completing request
Arguments: ('task(1h5yd9ci0sfqivw)', '', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, [], 4, <controlnet.py.UiControlNetUnit object at 0x000001FE2222B760>, <controlnet.py.UiControlNetUnit object at 0x000001FE2211CEE0>, <controlnet.py.UiControlNetUnit object at 0x000001FE222290F0>, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, 7, 'all', 'all', 'all', '', '', '', '1', 'none', False, '', '', 'comma', '', True, '', None, False, None, False, None, False, 50) {}
Traceback (most recent call last):
File "C:\AI\stable-diffusion-webui\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "C:\AI\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "C:\AI\stable-diffusion-webui\modules\txt2img.py", line 53, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "C:\AI\stable-diffusion-webui\modules\scripts.py", line 408, in run
processed = script.run(p, *script_args)
File "C:\AI\stable-diffusion-webui\extensions\OneButtonPrompt\scripts\onebuttonprompt.py", line 696, in run
preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring, prefixprompt, suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage)
TypeError: build_dynamic_prompt() takes from 0 to 12 positional arguments but 13 were given

Runtime Error, expected query

Traceback (most recent call last):
File "C:\AI\stable-diffusion-webui\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "C:\AI\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "C:\AI\stable-diffusion-webui\modules\txt2img.py", line 54, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "C:\AI\stable-diffusion-webui\modules\scripts.py", line 441, in run
processed = script.run(p, *script_args)
File "C:\AI\stable-diffusion-webui\extensions\OneButtonPrompt\scripts\onebuttonprompt.py", line 719, in run
processed = process_images(p)
File "C:\AI\stable-diffusion-webui\modules\processing.py", line 611, in process_images
res = process_images_inner(p)
File "C:\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
File "C:\AI\stable-diffusion-webui\modules\processing.py", line 731, in process_images_inner
x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))]
File "C:\AI\stable-diffusion-webui\modules\processing.py", line 731, in
x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))]
File "C:\AI\stable-diffusion-webui\modules\processing.py", line 519, in decode_first_stage
x = model.decode_first_stage(x)
File "C:\AI\stable-diffusion-webui\modules\sd_hijack_utils.py", line 17, in
setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
File "C:\AI\stable-diffusion-webui\modules\sd_hijack_utils.py", line 28, in call
return self.__orig_func(*args, **kwargs)
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\AI\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 826, in decode_first_stage
return self.first_stage_model.decode(z)
File "C:\AI\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\autoencoder.py", line 90, in decode
dec = self.decoder(z)
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\AI\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\model.py", line 631, in forward
h = self.mid.attn_1(h)
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\AI\stable-diffusion-webui\modules\sd_hijack_optimizations.py", line 620, in sdp_no_mem_attnblock_forward
return sdp_attnblock_forward(self, x)
File "C:\AI\stable-diffusion-webui\modules\sd_hijack_optimizations.py", line 612, in sdp_attnblock_forward
out = torch.nn.functional.scaled_dot_product_attention(q, k, v, dropout_p=0.0, is_causal=False)
RuntimeError: Expected query, key, and value to have the same dtype, but got query.dtype: float key.dtype: float and value.dtype: struct c10::Half instead.

Running latest A1111 and latest version of the extension, I disabled all other extensions except controlnet and the built-in ones and it still occurs.

When you generate the image appears but once complete it is removed and the error:

RuntimeError: Expected query, key, and value to have the same dtype, but got query.dtype: float key.dtype: float and value.dtype: struct c10::Half instead.

Is displayed.

hello some more!

It looks like you forgot to remove 68: print("hello some more!") in model_lists.py :)

UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f916' in position 141: illegal multibyte sequence

!!! Exception during processing !!!
Traceback (most recent call last):
File "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\OneButtonPrompt\OneButtonPromptNodes.py", line 74, in Comfy_OBP
generatedprompt = build_dynamic_prompt(insanitylevel,subject,artist,imagetype,False,"","","",1,"",custom_subject,True,"",imagemodechance, humanoids_gender, subject_subtype_objects, subject_subtypes_humanoids, subject_subtypes_concepts, False)
File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\onebuttonprompt\build_dynamic_prompt.py", line 1951, in build_dynamic_prompt
print(completeprompt)
File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\prestartup_script.py", line 24, in write
self.file.write(message)
UnicodeEncodeError: 'gbk' codec can't encode character '\U0001f916' in position 141: illegal multibyte sequence

Prompt executed in 0.42 seconds
adding something rare to the pro

OBP no longer showing in Scripts

So this is odd, and most probably my fault, but can you think of a reason why One Button Prompt won't show up any more in Scripts. Not on t2i or i2i. I've noticed that after I added a bunch of extensions, so I've started removing them but still no joy. I also tried just reinstalling OBP but nothing.
Auto1111 is updated to latest.
Any ideas for me to try? thanks

prefix becomes suffix when using <>

hello, I am trying to add <hypernet:LuisapSciFiHard_v1:1> as a prefix in one button prompt, instead it is placed at the end of the prompt. If I use regular text, it is prefixed as expected.
One Button Prompt version fca8b1c
using webui 1111 version 1.3.2

Hi. res fix on WebUI 1.4 keeps prompt of first image in the batch on normal generation with batch count > 1

example during normal generation:

Anime key visual of a Acclaimed Resourceful Tifa Lockhart, Playing trivia games, wearing [Alligator skin:Jute:18] Magenta [Parka:Vest:12], Inca hair, Regency Face Tattoos, Large Head, Spring, Still Life, Rembrandt lighting, Kodachrome, crisp lines
Steps: 30, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: 840270636, Size: 512x768, Model hash: b76cc78ad9, Model: dreamshaper_6BakedVae, Denoising strength: 0.4, Hires prompt: ["shoulder-level shot of a Glowing Woman riding a dark green dragon, fall foliage, Sunny, soft focus, Rough sketch, Peaceful, Surrealism Art, psychedelic colors"], Hires upscale: 2, Hires steps: 15, Hires upscaler: R-ESRGAN 4x+ Anime6B, Lora hashes: "studioGhibliStyle_offset: 708c39069ba6", Version: v1.4.0

This is now a property called hires prompt, which is filled with the FIRST prompt of the batch. Seems to be introduced in 1.4.

hires prompt should be the same as the normal prompt

Save configuration

Can you add a function to save configurations (presets) or load parameters from the last session?

Great Work!

Hi,
I have been looking for exactly this for the last 3 months! 😄
I forked your repo and added some custom code!

  • Automatic Quality Gate
  • Random Model Selection
  • Random Negative Embeddings usage
  • Different Upscaling
  • WebuiApi from @mix1009 (THANKS!)

If you'd like to implement some of those ideas, you can watch my fork and get an idea of how I did it.
The code I wrote is not ready for a PR but I could polish it further if you'd like.
Otherwise, I only say THANK YOU!

Keep it up! 😎

Overwrite subject

While using overwrite subject I was using a lora within the text field, this works fine, however if using the automated mode then it causes the script to error out.

`Traceback (most recent call last):3s/it]
File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 408, in run_predict
output = await app.get_blocks().process_api(

File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1315, in process_api
result = await self.call_function(

File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1043, in call_function
prediction = await anyio.to_thread.run_sync(

File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(

File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future

File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)

File "C:\AI\stable-diffusion-webui\extensions\OneButtonPrompt\main.py", line 127, in generateimages
txt2img = call_txt2img(randomprompt, size ,hiresfix, 0, filenamecomplete,model ,samplingsteps,cfg, hiressteps, denoisestrength,samplingmethod, upscaler,hiresscale,apiurl,qualitygate,quality,runs,negativeprompt)

File "C:\AI\stable-diffusion-webui\extensions\OneButtonPrompt\call_txt2img.py", line 148, in call_txt2img
image.save(outputTXT2IMGFull, pnginfo=pnginfo)

File "C:\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 2428, in save
fp = builtins.open(filename, "w+b")

OSError: [Errno 22] Invalid argument: 'C:\AI\stable-diffusion-webui\extensions\OneButtonPrompt\./automated_outputs/txt2img/20230518211142_large__young_woman__<lora_BlissV_>_0.png'`

Cannot select all upscaler in One Button Run and Upscale

for some reason the dropdown menu shows only all or automatic except in higresfix there it shows the latent ones. im using vladmanic webui. When i use all it randomly selects one and sometimes even downloads the ones i dont have, why is that? i cannot ifnd the problem in the python scripts so i might have overlooked it

Missing Samplers!

There are some Sampling methods missing!
What about load them dynamicly?

1111:
image

OneButtonPromt:
image

Image height and width issues

Request to add custom image size rather than limited 3 options. Please add height and width just like the webui. This extension is great but can be made better. Also I saw a message "It is illegal to generate this prompt" in the background cmd.exe. Please dont limit this prompt generator to not generate prompts, it will limit the creativity.
C

Index out of error when seelcting humanoid genders

The error occurs when selecting Humanoid from the Subject Types, then changing the gender to anything other than 'all" selecting either male or female will result in this error. Choice of Type of Humanoid has no effect.

Here is the error:

`Please note that existing prompt and negative prompt fields are (no longer) used
Starting generating the prompt
*** Error completing request
*** Arguments: ('task(qi51hrcqfh46tee)', '\n\n', '', [], 30, 0, False, False, 1, 1, 7, 3102042158.0, -1.0, 0, 0, 0, False, 768, 576, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], <gradio.routes.Request object at 0x000001F8A8B3B1F0>, 5, False, {'ad_model': 'face_yolov8n.pt', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_sampler': False, 'ad_sampler': 'Euler a', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_sampler': False, 'ad_sampler': 'Euler a', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 1536, 96, True, True, True, False, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, False, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, None, 'Refresh models', <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001F8A8B278E0>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001F84E36E140>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001F8A8AE5660>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001F8A8B24C10>, False, '', 0.5, True, False, '', 'Lerp', False, False, False, 'Matrix', 'Horizontal', 'Mask', 'Prompt', '1,1', '0.2', False, False, False, 'Attention', False, '0', '0', '0.4', None, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False, False, False, '#000000', False, 5, 'humanoid', 'popular', 'all', '', '', 'BadDream UnrealisticDream JuggernautNegative-neg ng_deepnegative_v1_75t verybadimagenegative_v1.3,', '1', 'none', False, '', '', 'comma', '', True, '', '20', 'male', 'all', 'humanoids', 'all', None, None, False, None, None, False, None, None, False, None, None, False, 50) {}
    Traceback (most recent call last):
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\modules\txt2img.py", line 59, in txt2img
        processed = modules.scripts.scripts_txt2img.run(p, *args)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\modules\scripts.py", line 501, in run
        processed = script.run(p, *script_args)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\extensions\OneButtonPrompt\scripts\onebuttonprompt.py", line 1031, in run
        preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring, prefixprompt, suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance,chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\extensions\OneButtonPrompt\build_dynamic_prompt.py", line 35, in build_dynamic_prompt
        fictionallist = csv_to_list(csvfilename="fictional characters",antilist=antilist,skipheader=True,gender=gender)
      File "C:\Users\xxx\Desktop\Automatic1111\stable-diffusion-webui\extensions\OneButtonPrompt\csv_reader.py", line 51, in csv_to_list
        (gender != "all" and row[1] == gender)
    IndexError: list index out of range

Nice

Hi! You haven't enabled discussions so I'll just write here.

First of all, thanks for the shoutout in your description. I have been planning on improving the lousy version that was in StylePile. For now the solution was to just ask an AI to generate a ton of interesting prompts, split them apart and then to either load them complete or merge like StylePile did up to now. But that still is a little clumsy so, for now, I decided to focus on doing something like that by hand using variables and such (can check it out at https://github.com/some9000/StylePile/tree/Beta-2.1 if you'd like).

It is interesting to see that we have both come up to certain ideas (like the way batch generation separates the prompts). But yours is, certainly a much more specialized product and it excels at that.

Prompt compounder does not replace templates in common prompt when active with Regional Prompter

I'm following the guide on creating awesome landscapes with prompt compounder and Regional Prompter.

When generating, the common prompt seems to just contain the template name without being replaced by the actual value, e.g., (-artist-:1.2).

Here is a full prompt generated with the settings from the documentation:

, [ (-artist-:1.2) ,-artist-:13], landscape
BREAK landscape of a Mysterious Hideous [Channel|Sagrada Familia], at Midday, Anime screencap, Grim, Minecraftcore, professional,
BREAK, studio On pale black paper, landscape of a Studied South Korea from inside of a Arch dam, Foggy conditions, Embarrassing, Modern European Ink Painting, 80mm, adobe lightroom,
BREAK, 8k Painting, landscape of a Daring Hyper-Creative Movie theater from inside of a Beach house, dense water, Spring, Wizardcore, F/8, Saturated

And another one:

, [ (-artist-:0.8) :-artist-:-artist-:16], landscape
BREAK Color splash, landscape of a Elusive Coral Reef, at Dusk, Simple illustration, Horror, F/2.8, Autochrome,
BREAK, Drawing, Bastardcore, landscape of a Twisted Shaky Eiffel Tower and Dune, Boorish dungeon, Summer, Realistic, Tranquil, Mono Color,
BREAK, landscape of a Ancient Glad Glasgow, at Dawn, Cel shading, Low shutter, Oversaturated

Awesome extension by the way!

path error

Team,
This may have been an error on my part during the install on my M1 Mac. When I attempted to run the script for the first time I received an error that the artists.csv could not be found: .\csvfiless\artists.csv not found.

I made and edit to the csv_reader.py file and updated the full_path var:
diff csv_reader.py csv_reader.py_bak
7c7
< full_path = os.path.join(script_dir, "./csvfiles/" )

full_path = os.path.join(script_dir, ".\\csvfiles\\" )

24c24
< full_path = os.path.join(script_dir, "./csvfiles/" )

    full_path = os.path.join(script_dir, ".\\csvfiles\\" )

The script is working now. Planning on having lots of fun with it tomorrow.
Thanks!!

"Filter out" not working?

I really like this extension. Well done! I'm interested in filtering out some words from the prompts, but the filter out field doesn't seem to be working. I put comma-separated words in that field like "film grain" and "render" (without the quotes) and yet I still get images with those terms in the prompt. Am I doing something wrong?

Imports not working on ComfyUI

I'm moving to ComfyUI from Automatic1111 and was pleased to discover that OneButtonPrompt exists for ComfyUI as well. Unfortunately, when I start ComfyUI (latest commit as of posting is comfyanonymous/ComfyUI@0cb14a3 which is the commit I'm using) I get the following:

12:02:23 - ReActor Node - STATUS - Running v0.1.0 in ComfyUI
Traceback (most recent call last):
  File "/home/user/ComfyUI/nodes.py", line 1647, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/user/ComfyUI/custom_nodes/OneButtonPrompt/__init__.py", line 1, in <module>
    from .OneButtonPromptNodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "/home/user/ComfyUI/custom_nodes/OneButtonPrompt/OneButtonPromptNodes.py", line 13, in <module>
    from build_dynamic_prompt import *
ModuleNotFoundError: No module named 'build_dynamic_prompt'

Cannot import /home/user/ComfyUI/custom_nodes/OneButtonPrompt module for custom nodes: No module named 'build_dynamic_prompt'

With a bit of detective work from the error, I tried changing

from build_dynamic_prompt import *

to

from .build_dynamic_prompt import *

in OneButtonPromptNodes.py

That got me this error:

12:09:35 - ReActor Node - STATUS - Running v0.1.0 in ComfyUI
Traceback (most recent call last):
  File "/home/user/ComfyUI/nodes.py", line 1647, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/user/ComfyUI/custom_nodes/OneButtonPrompt/__init__.py", line 1, in <module>
    from .OneButtonPromptNodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "/home/user/ComfyUI/custom_nodes/OneButtonPrompt/OneButtonPromptNodes.py", line 13, in <module>
    from .build_dynamic_prompt import *
  File "/home/user/ComfyUI/custom_nodes/OneButtonPrompt/build_dynamic_prompt.py", line 3, in <module>
    from csv_reader import *
ModuleNotFoundError: No module named 'csv_reader'

Cannot import /home/user/ComfyUI/custom_nodes/OneButtonPrompt module for custom nodes: No module named 'csv_reader'

So I changed build_dynamic_promt.py from

from csv_reader import *
from random_functions import *

to

from .csv_reader import *
from .random_functions import *

and things seem to work properly now.

I'm using AMD Rocm and Python 3.11, in case that's relevant. I'm not familiar with Git/GitHub enough to be comfortable trying to make a pull request, and I'm not familiar enough with the projects involved here to know how useful (or not) my changes are in the grand scheme of things. I haven't tested these changes against Automatic1111 to know if they break anything there, for example. But this should document my amateur attempt to get this working for my needs, and if it turns out to fix something that's broken more widely, I hope my experience is useful.

FileNottFound Error Images not saving

[Errno 2] No such file or directory: 'C:\Users\rkran\AI-StableDiffusion\stable-diffusion-webui\extensions\OneButtonPrompt./automated_outputs/txt2img/20230708021655_enshogun_(genshin_impact)__0.png'. Whenever an image finishes generating i get an error like this. What should i do?

Unable to start, syntax error

I've installed this script on the latest Automatic1111 as well as the commit before the March 25'th updates, I'm seeing the following error on both:

Error loading script: onebuttonprompt.py
Traceback (most recent call last):
  File "/home/zetaphor/stable-diffusion-webui-latest/modules/scripts.py", line 256, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "/home/zetaphor/stable-diffusion-webui-latest/modules/script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/zetaphor/stable-diffusion-webui-latest/extensions/OneButtonPrompt/scripts/onebuttonprompt.py", line 10, in <module>
    from build_dynamic_prompt import *
  File "/home/zetaphor/stable-diffusion-webui-latest/extensions/OneButtonPrompt/build_dynamic_prompt.py", line 383
    match random.choice(backgroundtype):
          ^
SyntaxError: invalid syntax

Suffix removing commas

I enter to suffix <lyco:Margot RobbieV2:1> , lora:add_detail:1.3
And in log have just <lyco:Margot RobbieV2:1> lora:add_detail:1.3 without comma!

One Button Run and upscale fails on v1.5

File "C:\stable-diffusion\webui\stable-diffusion-webui\extensions\OneButtonPrompt-dev\main.py", line 48, in generateimages
currentlyselectedmodel = optionsresponsejson["sd_model_checkpoint"]
KeyError: 'sd_model_checkpoint'

Investigating the issue.

Pretty consistent (but not all the time) error.

I get this message a lot. I'm not extremely tec savvy, so it might be slightly different each time, but it always ends the same way. It does not always happen though. It seems rather random. I'm never able to produce a long list of images though, since it is more likely to happen than not if I'm running even 4 image generations at a time. Anything higher than that is doomed for me personally.
Here is the command lines and error:

Setting insanity level to 5
adding something rare to the prompt
Nice! adding something legendary to the prompt
extreme wide shot of a Dunmer with a Elk, Geass, Face mask, from inside of a Impressive Hotel, at Dusk, Knightcore, 50mm
Going to run with sampling method Heun
Going to run with upscaler Latent (nearest-exact)
Traceback (most recent call last):
File "C:\Users\Gaming\Desktop\Stable Diffusion\Vlad A111\automatic\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "C:\Users\Gaming\Desktop\Stable Diffusion\Vlad A111\automatic\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api
result = await self.call_function(
File "C:\Users\Gaming\Desktop\Stable Diffusion\Vlad A111\automatic\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\Users\Gaming\Desktop\Stable Diffusion\Vlad A111\automatic\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\Users\Gaming\Desktop\Stable Diffusion\Vlad A111\automatic\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "C:\Users\Gaming\Desktop\Stable Diffusion\Vlad A111\automatic\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "C:\Users\Gaming\Desktop\Stable Diffusion\Vlad A111\automatic\extensions\OneButtonPrompt\main.py", line 140, in generateimages
txt2img = call_txt2img(randomprompt, size ,hiresfix, 0, filenamecomplete,model ,samplingsteps,cfg, hiressteps, denoisestrength,samplingmethod, upscaler,hiresscale,apiurl,qualitygate,quality,runs,negativeprompt)
File "C:\Users\Gaming\Desktop\Stable Diffusion\Vlad A111\automatic\extensions\OneButtonPrompt\call_txt2img.py", line 138, in call_txt2img
for i in r['images']:
KeyError: 'images'

button run and upscale doesn't work anymore

hi
when i try to use the one button run and upscale i got this error everytime
and i reinstalled SD automatik 1111 clean but same error
Traceback (most recent call last):
File "C:\stable_diff\sd.webui\system\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "C:\stable_diff\sd.webui\system\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "C:\stable_diff\sd.webui\system\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\stable_diff\sd.webui\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\stable_diff\sd.webui\system\python\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "C:\stable_diff\sd.webui\system\python\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "C:\stable_diff\sd.webui\system\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "C:\stable_diff\sd.webui\webui\extensions\OneButtonPrompt\main.py", line 54, in generateimages
currentlyselectedmodelhash = optionsresponsejson["sd_checkpoint_hash"]
KeyError: 'sd_checkpoint_hash'

thanks for the feedback ^^

error when using generate and upscale option "sd_checkpoint_hash"

Traceback (most recent call last):
File "C:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "C:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api
result = await self.call_function(
File "C:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "C:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "C:\stable-diffusion-webui\extensions\OneButtonPrompt\main.py", line 52, in generateimages
currentlyselectedmodelhash = optionsresponsejson["sd_checkpoint_hash"]
KeyError: 'sd_checkpoint_hash'

Lora/lyco names with spaces are formatted and thus not working

Hi.

You don't need any lora to check that this problem exist. Just copy this <lora:some lora(With description):0.5> to "Overwrite subject" or any other field which works with user's input. And see how it will be transformed during generation to <lora:some lora (With description) :0.5>.

[Broke] takes from 0 to 13 positional arguments but 14 were given

version: [v1.3.2]  •  python: 3.10.6  •  torch: 2.0.0+cu118  •  xformers: 0.0.17  •  gradio: 3.32.0  •  checkpoint: [e4a30e4607]

Please note that existing prompt and negative prompt fields are (no longer) used
Starting generating the prompt
Error completing request
Arguments: ('task(e6wqiii7r9jzr34)', '', 'negative_hand-neg, easynegative:0.5, lowres, low quality:1.4, worst quality:1.4, bad eyes, monochrome, greyscale, signature, watermark, deformed pupils, deformed iris', [], 50, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, True, 0.35, 2, 'R-ESRGAN 4x+', 15, 0, 0, 0, '', '', [], 4, 0, 0, 2, 512, 512, True, 'R-ESRGAN 4x+', 'None', 0, True, 'keyword, prompt', 'Mature Adult', 'None', 'model keyword first', 'None', '1.2', 'None', False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 1, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 1536, 96, True, True, True, False, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002DC8F4EA5C0>, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, 5, 'humanoid', 'realism', 'digital art', '', '', '', '1', 'none', False, '', '', 'comma', '', True, '', '20', '', '', 0, None, None, False, 50) {}
Traceback (most recent call last):
File "G:\Automatic1111\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "G:\Automatic1111\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "G:\Automatic1111\modules\txt2img.py", line 54, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "G:\Automatic1111\modules\scripts.py", line 441, in run
processed = script.run(p, *script_args)
File "G:\Automatic1111\extensions\OneButtonPrompt\scripts\onebuttonprompt.py", line 736, in run
preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring, prefixprompt, suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance)
TypeError: build_dynamic_prompt() takes from 0 to 13 positional arguments but 14 were given

Unable to use the Save button

I noticed when using this it has an issue when it comes to saving an image/prompt. It gives me the following error in the console when attempting to save an image.

As a result the image and the prompt are not being saved when using the "Save" button while using this script.

Note: I have my Automatic 1111 configured to:

Add number to filename when saving
Do not save grids consisting of one picture
Save text information about generation parameters as chunks to png files
Create a text file next to every image with generation parameters.
 When using "Save" button, save images to a sub-directory

I have the images being saved to a sub-directory on a different drive

My SD/Automatic 1111 is:

commit 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 (HEAD -> master)
Merge: 65995a2e f71a3c9c
Author: AUTOMATIC1111 <[email protected]>
Date: Mon Feb 20 14:45:54 2023 +0300


Error:Traceback (most recent call last):

File "D:\StableDifusion\stable-diffusion-webui\modules\call_queue.py", line 56, in f

res = list(func(*args, **kwargs))

File "D:\StableDifusion\stable-diffusion-webui\modules\ui_common.py", line 73, in save_files

fullfn, txt_fullfn = modules.images.save_image(image, path, "", seed=p.all_seeds[i], prompt=p.all_prompts[i], extension=extension, info=p.infotexts[image_index], grid=is_grid, p=p, save_to_dirs=save_to_dirs)

IndexError: list index out of range

Error completing request


Error while using One Button Prompt with Regional Prompter in SD.Next

I use a fork of A1111 webui called SD.Next. Following the guide of "prompt_compounder_and_regional_prompter_to_create_insane_images" I tried to generate the landscape example which got finished but I got an error, and from what the generated picture looks like the regional prompter didn't work:

[1] [[1.0, 1.0, 1.0]]
Starting generating the prompt
Critical hit! Something unique has been added to the prompt
only generated these artists:(art by Mike Allred:1.3) ,art by Max Pechstein
Running in quality vomit mode
Critical hit! Something unique has been added to the prompt
Critical hit! Something unique has been added to the prompt
adding something rare to the prompt
adding something rare to the prompt
Critical hit! Something unique has been added to the prompt
Nice! adding something legendary to the prompt
Critical hit! Something unique has been added to the prompt
Critical hit! Something unique has been added to the prompt
Critical hit! Something unique has been added to the prompt
Critical hit! Something unique has been added to the prompt
Complex background, Glowwave, [Enthralling|Psychadelic] Miserable (The Water Gardens of Dorne:1.3) from inside of a Summer Camp, Golden ratio, Hippie Art, ethereal magical atmosphere,
 BREAK, raytraced reflections, made of Flannel, Flowery Breathtaking (City:1.3) and Heartwarming Sci-fi Pedestrian tunnel, Green and fluorescent purple splash, Amaro, Kintsugi, 4K, dripping with Red, Ribbons, most beautiful artwork in the world,
 BREAK, Injured [Greedy:Pitiful:17] (Monument Valley:1.3) , Concept Art World, Crimson power aura

Full prompt to be processed:

(art by Mike Allred:1.3) ,art by Max Pechstein, landscape
 BREAK Complex background, Glowwave, [Enthralling|Psychadelic] Miserable (The Water Gardens of Dorne:1.3) from inside of a Summer Camp, Golden ratio, Hippie Art, ethereal magical atmosphere,
 BREAK, raytraced reflections, made of Flannel, Flowery Breathtaking (City:1.3) and Heartwarming Sci-fi Pedestrian tunnel, Green and fluorescent purple splash, Amaro, Kintsugi, 4K, dripping with Red, Ribbons, most beautiful artwork in the world,
 BREAK, Injured [Greedy:Pitiful:17] (Monument Valley:1.3) , Concept Art World, Crimson power aura
04:29:13-809438 ERROR    Running script process: extensions\sd-webui-regional-prompter\scripts\rp.py: AttributeError
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ D:\DOWNLOAD\AI\StableDiffusion\automatic\modules\scripts.py:470 in process                                          │
│                                                                                                                     │
│   469 │   │   │   │   args = p.per_script_args.get(script.title(), p.script_args[script.args_f                      │
│ > 470 │   │   │   │   script.process(p, *args, **kwargs)                                                            │
│   471 │   │   │   except Exception as e:                                                                            │
│                                                                                                                     │
│ D:\DOWNLOAD\AI\StableDiffusion\automatic\extensions\sd-webui-regional-prompter\scripts\rp.py:440 in process         │
│                                                                                                                     │
│    439 │   │   loraverchekcer(self)                                                  #check web                     │
│ >  440 │   │   if not nchangeand: allchanger(p, "AND", KEYBRK)                                                      │
│    441 │   │   if any(x in self.mode for x in ["Ver","Hor"]):                                                       │
│                                                                                                                     │
│ D:\DOWNLOAD\AI\StableDiffusion\automatic\extensions\sd-webui-regional-prompter\scripts\rp.py:625 in allchanger      │
│                                                                                                                     │
│    624 def allchanger(p, a, b):                                                                                     │
│ >  625 │   p.prompt = p.prompt.replace(a, b)                                                                        │
│    626 │   for i in lange(p.all_prompts):                                                                           │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
AttributeError: 'list' object has no attribute 'replace'
100%|██████████████████████████████████████████████████████████████████████████████████| 40/40 [00:11<00:00,  3.63it/s]
04:29:27-916846 INFO     Processed: images=1 time=13.93s its=2.87 memory={'ram': {'used': 4.36, 'total': 31.89}, 'gpu':
                         {'used': 3.59, 'total': 6.0}, 'retries': 0, 'oom': 0}

Batch size

After setting the batch size and using this script, images will not be generated in batches according to the batch size, but rather generated one after another.

[ComfyUI] - Same seed produces random prompts

I'm using ComfyUI

Issue:

"One Button Prompt" node
I'm feeding it a fixed integer seed but whenever I restart ComfyUI and use the same exact workflow with all settings exactly the same including the seed, the resulting prompt is completely different.

Expected behaviour:

"One Button Prompt" node should produce exactly the same prompt every single time when the seed and other parameters are the same.

Example workflow: seed_issue.zip

Before restart
chrome_0UYo6mpEjL

After restart
chrome_zhCGB7IIEU


Thank you. I love these custom nodes but this one issue makes it pretty unusable for me.

Feature request: Adding tiled diffusion upscaler for image 2 image and change location from dropdown script to always visible tab

I think it's a great idea to add this multi diffusion upscaler extension as an option. I am assuming it is possible because already control net tiling and ultimate sd upscalers are available optionally.

Also, it would be great to make this extension permanently visible, rather than to select from a dropdown menu of scripts. This will also allow it to be used with other scripts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.