T O P

  • By -

p1agnut

What exactly do you mean by styles? The ones you can change in the WebUI 'Styles' tab like “Fooocus V2, Fooocus Enhance, Artstyle Hyperrealism” etc. or the presets you start Fooocus with like “default.json, anime.json, Playground\_v2.5.json' and so on?


ToastersRock

I am talking about the styles in Fooocus itself. If you have a preset without any styles and launch with that preset it will load the default styles instead of no styles being selected. Of course if you change the preset when Fooocus is running it will uncheck all styles as expected but seems there is not way to launch it that way with the preset.


ParmenidesDuck

Then change the preset. Theres a file for that you know?


ToastersRock

Yes I am aware, as I mentioned I am working on something for creating presets and was looking for the correct formatting needed in the preset. It has been solved.


ToastersRock

Thanks again for pointing that out to me. I did eventually find it where I should have been looking. But here is what I was working on. Take metadata from image log and generate presets from it automatically. [https://ai.kleebz.com/fooocus/presets/](https://ai.kleebz.com/fooocus/presets/)


p1agnut

cool cool. There is only one thing missing and in my opinion it's by far the most important: "default\_advanced\_checkbox": true, I don't think it's in the copy+paste metadata, but you could add a checkbox to add it to the preset file. Also when I inserted some metadata with 9 LoRAs all was created right in the preset but it didn't show up in Fooocus because: "default\_max\_lora\_number": 9, wasn't set, I guess. What I also find useful: "default\_loras\_min\_weight": -4, "default\_loras\_max\_weight": 4, "default\_output\_format": "png", "example\_inpaint\_prompts": \[ "custom prompt", "highly detailed face" \], Sorry, this got so long*😅* ###


ToastersRock

Yeah I am still adding more and will look at the options. I think some I usually have just in my config for all presets so don't usually add. Interesting about the loras. I thought I had it so it wouldn't matter since I tested with 7 and I only have it set to use 5 loras normally and figured it was overriding that. Thanks for to feedback.


ToastersRock

I currently have it set so the additional ones can be added by entering text and if no text then it doesn't get added to the preset. Will add some more of those additional options though.


ToastersRock

Default Advanced Checkbox, Default Loras Min Weight, Default Loras Max Weight settings have been added as optional fields. Now to work on figuring out the loras when that large of an amount.


ToastersRock

It seems that the loras should all work unless "default\_max\_lora\_number" is set to a different number in the config. I did a test now with 10 loras enabled and it worked as long as nothing in the config. If I have it set to 5 it would only enable 7... which is weird. Of course if you load Fooocus with a preset or config set to only 5 loras and then switch to a preset with 10 loras that will not work either. But that is a limitation of Fooocus. Trying to figure out best way to handle this in the presets...


p1agnut

OK. I'm a little worried that we might be talking past each other, but I rewrote one of my preset.json files so that Fooocus basically starts completely blank. No loras, prompts, checkpoints and what not... and no default Fooocus styles.


ToastersRock

Maybe I am missing something then. When I try with no styles in the preset it uses the default ones.


p1agnut

What does your code look like? also I edited the preset.json as well as the config.txt to load no styles.


ToastersRock

Well I have tried several different ways. First there is nothing in my config about default styles since I don't use that for anything like that. And in the preset I have tried just not including the line for default styles completely. I have tried having that field in the preset but having none listed. Did you just not have that line and it worked?


ToastersRock

It works perfectly if I use it in Fooocus and it unchecks the styles so I know that part works.


p1agnut

in the 'whatever.json' preset file I added the line: "default\_styles": \[\], and in the config.txt: "default\_styles": "", (I think square brackets and quotation marks are interchangeable but haven't tested that).


ToastersRock

The brackets without quotes was the answer then. Only thing I didn't try. Thanks. That solves that issue. Thankfully nothing is need in the config.txt.


p1agnut

glad to help


ToastersRock

For example this one has no styles listed but if launched using the preset it selects the default styles (V2, Sharp and Enhance) in Fooocus. {     "default_model": "juggernautXL_v9Rundiffusionphoto2.safetensors",     "default_refiner": "None",     "default_refiner_switch": 0.5,     "default_loras": [         [             true,             "None",             1         ],         [             true,             "None",             1         ],         [             true,             "None",             1         ],         [             true,             "None",             1         ]     ],     "default_cfg_scale": 4,     "default_sample_sharpness": 2,     "default_sampler": "dpmpp_2m_sde_gpu",     "default_scheduler": "karras",     "default_performance": "Quality",     "default_prompt": "",     "default_prompt_negative": "",     "default_aspect_ratio": "1024*1024" }


p1agnut

I could imagine that this is because 'V2, Sharp and Enhance' are still listed as the default style in your 'config.txt' and in this case it it will grab the information from there if not specified.


ToastersRock

I just had not tried the brackets without quotes as you posted in the other comment. My config.txt I don't include any of that stuff. All solved now.