sd-dynamic-prompts icon indicating copy to clipboard operation
sd-dynamic-prompts copied to clipboard

wildcard in JSON format

Open CharlesCato opened this issue 1 year ago • 12 comments

I don't know if I do something wrong, but I can't have a wildcard working as soon as it is in json format. I tried with the exemple given in the doc (and corrected the ' after Van Goth into ") but when I refresh wildcards, nothing appears in the list. No clothing, nor artists, nor anything with the filename (called it main.json). I wanted to try json to test if the if/else/then was working with wildcards.

{
	"clothing": [
		"T-shirt",
		"Pants",
		"Shoes"
	],
	"artists": {
		"finnish": [
			"Akseli Gallen-Kallela",
			"Eero Järnefelt",
			"Helene Schjerfbeck"
		],
		"dutch": [
			"Piet Mondrian",
    			"Rembrandt van Rijn",
    			"Vincent van Gogh"
		]
	}
}

Thank you for your time !

CharlesCato avatar Sep 06 '23 07:09 CharlesCato

Do you see the entries appear in the Wildcards Manager tab?

akx avatar Sep 11 '23 08:09 akx

Do you see the entries appear in the Wildcards Manager tab?

when I refresh wildcards, nothing appears in the list. No clothing, nor artists, nor anything with the filename (called it main.json).

CharlesCato avatar Sep 15 '23 07:09 CharlesCato

I also checked the file on an online json-validator without issues. I also made yaml file without any problems. But there is no if/then in yaml. So i really wanted to try json.

BTW: I'm using vlado repo since I'm on Radeon. Maybe there is something in his repo that prevent dynamic prompts working with json files. Who knows. I've searched in the discussions and it seems nobody ever tried json format or speak about it anyway. Are we even sure it's working or....

CharlesCato avatar Sep 15 '23 07:09 CharlesCato

when I refresh wildcards, nothing appears in the list. No clothing, nor artists, nor anything with the filename (called it main.json).

Then I'd say the file is not found.

I've searched in the discussions and it seems nobody ever tried json format or speak about it anyway. Are we even sure it's working or....

I copied the JSON from your post, pasted it into a file,

$ pbpaste > extensions/sd-dynamic-prompts/wildcards/issue619.json

and the wildcards are correctly populated: Screenshot 2023-09-15 at 12 25 45 Screenshot 2023-09-15 at 12 25 40

akx avatar Sep 15 '23 09:09 akx

That's very strange. Don't know why it's not opening json files on my config then. :( Even tried to remove every other files to let only the json, and nothing. I mean.... it can't be notepad++ f***** up the format ? I'll try more after lunch.

CharlesCato avatar Sep 15 '23 09:09 CharlesCato

Well... I give up json. Not working with my config. There is no point trying more. Not sure what to do with the issue though. Still unresolved, but since I don't know anybody who could try with vlado repo+amd, I'm stucked.

CharlesCato avatar Sep 15 '23 11:09 CharlesCato

Just to make sure, you are putting the JSON in the extension's wildcard directory? Are there any errors in the console?

akx avatar Sep 15 '23 14:09 akx

Yeah... same place as my other wilcards files. No errors concerning DynaPrompts. Some for dynamic thresholding and script/hook.py. But nothing I can fix manually. These errors come and go as upgrades come. I could try to updrage again. But it never worked anyway. Even with 0 errors.

CharlesCato avatar Sep 15 '23 14:09 CharlesCato

same thing to me , can't see any .json file in that directory. Did some research on the net to check if there was a special way of using this .json file but didn't find anything , only .txt files are recognized

Autantpourmoi avatar Oct 08 '23 13:10 Autantpourmoi

1st thought: @Autantpourmoi What repo are you using ? 2nd thought: @akx Can't be a country localization, right ? (just a thought thrown in the air. cause I'm pretty sure he is also french).

CharlesCato avatar Nov 23 '23 11:11 CharlesCato

Hi, same problem with yaml files. Refreshing do nothing. Renaming the file from .json or .yaml to .txt and the file show normally in the manager.

ema7569 avatar Nov 27 '23 22:11 ema7569

.json or .yaml to .txt Well they all uses different syntaxes though. If your yaml isn't valid, it won't show.

CharlesCato avatar Dec 02 '23 13:12 CharlesCato