mirror of
https://github.com/ahgsql/StyleSelectorXL.git
synced 2026-11-05 00:37:24 +00:00
[GH-ISSUE #20] Select style list to use (json files) #14
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ahgsql/StyleSelectorXL#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JeromeGH on GitHub (Sep 26, 2023).
Original GitHub issue: https://github.com/ahgsql/StyleSelectorXL/issues/20
Please implement the option to select between several style lists (json files)
https://youtu.be/6aZONG75dr0?si=VQulP95bdRlYjH77&t=180
@benjamin-bertram commented on GitHub (Oct 3, 2023):
I really dig this features as well, so I tried to bring this to work, but my styles won't just get not updated. Any thoughts on this? This was my approach after 8hrs of work (I am not a coder though)
I added a simple
def getFile(): styleFile = [f for f in os.listdir(folder) if f.endswith('.json')] return styleFileand updated the class and the ui so far, but I am stuck on the automated update. I can select my files from the dropdown, but nothing happens.
`class StyleSelectorXL(scripts.Script):
def init(self) -> None:
super().init()
self.styleFile = getFile()
self.initial_file = gr.State(self.styleFile[0] if self.styleFile else "sdxl_styles.json")
self.styleNames = self.getStyles(self.initial_file.value)
@benjamin-bertram commented on GitHub (Oct 5, 2023):
I got something working here:
https://github.com/benjamin-bertram/StyleSelectorXL_JsonSelector