Commit Graph

35 Commits

Author SHA1 Message Date
cmdr2
9ca8cf810b
Merge pull request #1003 from patriceac/patch-50
Notify plugins when image tags get refreshed
2023-03-14 10:41:12 +05:30
patriceac
1fda12640f
Custom Image Modifiers dialog tweaks (#935)
* Custom Image Modifiers dialog tweaks

Couple minor usability improvements for the custom image modifiers dialog:
- set the focus to the textbox when opening the dialog
- pressing the Escape key closes the dialog

* Adding keyboard shortcuts

Escape to cancel the changes, Ctrl+Enter to confirm the changes. No change to the existing UI behavior using the mouse.

* Make the overlay focusable

Allows the keyboard shortcuts to work if user clicks on the main window rather than the textbox itself.

* Disable spell and grammar correction
2023-03-14 10:37:21 +05:30
patriceac
079402cb2f
Fix restoration of weighted tasks with truncated modifiers (#956)
* Fix restoration of weighted tasks with truncated modifiers

* Reverting this change

Will create a separate PR for this as needed. Doesn't impact the other bug fix.

* Update utils.js
2023-03-14 10:36:21 +05:30
patriceac
257b14ee09
Notify plugins when image tags get refreshed
Image modifiers may be temporarily hidden by plugins like searchable modifier search box, and when restoring a task (e.g. use settings) the image modifier s copied with the hidden class set, which makes it look like it's missing.

By notifying plugins that the image tags have been refreshed, it allows it to act accordingly (in this case by making sure image tags are visible).
2023-03-12 01:23:05 -08:00
JeLuF
3b708e8d44 Fix autosave of modifiers image style 2023-03-10 21:23:16 +01:00
patriceac
0e57487774
Preserve full names for shortened modifiers (#945)
* Preserve full names for shortened modifiers

The PR https://github.com/cmdr2/stable-diffusion-ui/pull/779/files added code to preserve the full names of truncated image modifiers, but only in the "short image modifiers" code path. This PR fixes that by preserving the full car name for truncated modifier names too.

* Pick the full modifier name

The previous code selected the entire innerText from the modifier-car-label element, but for truncated modifiers this would also include the tooltip text. This modification fixes that by only picking specifically the full modifier name.

* Only pick the full modifier name

Previous code would pick up the tooltip text too, causing a mismatch of strings in the comparison.

* Display the truncated image modifier names

What we process and compare is always the full image modifier string, but we still want to display a shortened string when applicable.
2023-02-28 14:42:24 +05:30
patriceac
5698473891
Renaming custom-modifier-category to modifier-category 2023-02-24 13:55:18 -08:00
patriceac
a6f94959fe
DOM tweaking to identify custom categories
This is purely a DOM update to be able to identify the custom category a given custom image modifier is part of, e.g. using .closest() from a custom modifier plugin. No UI change.
2023-02-24 01:16:14 -08:00
cmdr2
4bc7bca60d
Merge pull request #924 from patriceac/patch-37
Allow modifier images to be passed as base64 images
2023-02-22 19:28:47 +05:30
patriceac
14118f142c
Update image-modifiers.js
Reloading of image tags with ((weight modifiers)) doesn't reuse the modifier card even if it exists, which means images are not restored either. This change fixes that behavior by ensuring proper matching of the tags with existing modifiers.
2023-02-22 00:57:03 -08:00
patriceac
9b99be4c1d
Allow modifiers to be passed as base64 images
No change in existing UI behavior, this change allows image modifier plugins to (optionally) pass the card image as a base64-encoded image rather than a source file.
2023-02-22 00:06:07 -08:00
patriceac
66d311258a Fix card names and toggling
Fix names and toggling for cards starting  with "By ", e.g. "By the ocean".
2023-01-16 23:56:44 -08:00
patriceac
ad8d1f77df Proper restoration of inactive image modifiers
Inactive image modifiers (right click on image tag) are not properly restored by Use Settings and Copy/Paste settings. This PR fixes that.
2022-12-28 13:41:36 -08:00
patriceac
48a3254ad2 Adding image modifiers events
Adding events to allow plugins to listen for image modifiers loaded and refreshed events respectively.
2022-12-26 12:16:36 -08:00
JeLuF
0f96688a54
Highlight artist modifiers when clicked (#596)
Artist modifiers, with the exception of Artstation (the first one), don't have the outline when selected. All the other modifiers, above or below, seem to work as intended

https://discord.com/channels/1014774730907209781/1014774732018683927/1048343258775949322
2022-12-03 22:18:57 +05:30
patriceac
ca9413ccf4
Toggle image modifiers plugin (#558)
* Toggle image modifiers plugin

Right-click on image modifiers to temporarily turn them off without removing them. To quickly iterate and experiment with various combinations.

Please note this plugin required a minor tweak in getPrompts() to add support for image modifier inactive state.

* Fix tag matching

Co-authored-by: cmdr2 <secondary.cmdr2@gmail.com>
2022-12-01 15:10:36 +05:30
cmdr2
1ead764a02
Merge branch 'beta' into Custom-modifiers-as-a-plugin 2022-12-01 14:57:39 +05:30
patriceac
40ebf468d3 Hotfix for repeat image modifiers
As per Discord conversation, this PR fixed the image modifiers behavior when a modifier appears more than once, and also fixes a regression introduced by ((weighted modifiers)).
2022-11-30 22:13:13 -08:00
cmdr2
1949d8a50c Tweak modifiers help msg 2022-11-30 16:32:43 +05:30
cmdr2
7c50b8bf94
Merge branch 'beta' into Mouse-wheel-behavior-fixes 2022-11-30 16:22:45 +05:30
cmdr2
159c3edfe3 Simplify the logic for toggling modifier cards, no need to loop through the cards, since we already have the card object in hand 2022-11-30 13:33:20 +05:30
cmdr2
f74fa8657b
Merge pull request #518 from patriceac/patch-6
Fix duplicate custom modifiers activation states
2022-11-30 13:27:14 +05:30
patriceac
e278e639a3 Fix removal of image modifiers with non-zero weights
Properly handles removal of image modifiers that had (((modifiers))) or [[[modifiers]]] updated at runtime.
2022-11-27 03:00:19 -08:00
patriceac
c56a2adbcb Custom modifiers as a plugin 2022-11-22 19:04:20 -08:00
patriceac
cbc48e31e1
Fix duplicate custom modifiers activation states
Fixing activation state for custom modifier cards sharing the same tag where only one of the cards gets (de)activated.
2022-11-19 19:25:28 -08:00
patriceac
577dd9048f
Fix duplicate custom modifiers restoration
Fix for duplicate image modifiers when restoring a task in which several custom modifier cards share the same tag.
2022-11-19 19:21:36 -08:00
patriceac
903acff924 Adding Use Settings 2022-11-10 18:36:39 -08:00
cmdr2
bca98269bb Fix a bug where the custom image modifiers button would close the modifiers panel 2022-11-09 13:46:50 +05:30
Malcolm Diller
484e53cc08 made first large swathe of changes for ui reorganization 2022-11-01 23:03:05 -07:00
Malcolm Diller
09c11a385d normalized popups 2022-10-28 16:48:32 -07:00
cmdr2
eb1a276e60 Move the image modifers toolbar back to the top 2022-10-21 14:54:45 +05:30
cmdr2
a53bac1a94 Fix a bug where a null value for custom modifiers would break 2022-10-21 14:43:32 +05:30
cmdr2
93bf93d3a1 Fix a bug where a null value for custom modifiers would break 2022-10-21 14:42:02 +05:30
cmdr2
48a88a8624 Custom modifiers 2022-10-21 14:08:16 +05:30
cmdr2
4da9843479 Move image modifiers JS to a separate file 2022-10-18 22:28:04 +05:30