Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preset for SDXL Turbo (model DreamShaperXL_Turbo) #1580

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mashb1t
Copy link
Collaborator

@mashb1t mashb1t commented Dec 24, 2023

closes #1499
discussion in #1060

references

What's wondering me is that the list "possible_preset_keys" (config.py) isn't used when loading presets, see https://github.com/lllyasviel/Fooocus/blob/main/modules/config.py#L82-L95, config_dict.update(json.load(json_file)).

In this case the behaviour good, so one can simply add default_override_step to the preset and it's working perfectly fine.
Please let me know if you'd rather also have the key default_override_step in possible_preset_keys.

I'd also propose to add a license hint to the readme if/when adding turbo to the list of presets and to the installer.
Example from https://civitai.com/models/215418:

NOTE ON LICENSING - This model is based on the SDXL Turbo model released by Stability AI. They have flagged the model as being released under a non-commercial research license that permits personal, non-commercial use only. Be aware this model cannot be used for image generation services at this time.

Thanks!

includes default_override_step = 6
@siriume
Copy link

siriume commented Dec 25, 2023

I think this preset is not as good as a performance selection, 'cause it overrides the number of steps

@siriume
Copy link

siriume commented Dec 25, 2023

add here

if performance_selection == 'Speed':

        if performance_selection == 'Turbo Speed':
            print('Enter SDXL Turbo mode.')
            progressbar(async_task, 1, 'Downloading SDXL Turbo components ...')
            # change this to config.py could be better
            modules.config.load_file_from_url(
                url='https://huggingface.co/Lykon/dreamshaper-xl-turbo/resolve/main/DreamShaperXL_Turbo_dpmppSdeKarras_half_pruned_6.safetensors',
                model_dir=modules.config.path_checkpoints,
                file_name='DreamShaperXL_Turbo_dpmppSdeKarras_half_pruned_6.safetensors'
            )

            refiner_model_name = 'None'
            sampler_name = advanced_parameters.sampler_name = 'dpmpp_sde'
            cfg_scale = guidance_scale = 2.0
            modules.patch.sharpness = sharpness = 3.0
            steps = 6

@xhoxye
Copy link
Contributor

xhoxye commented Dec 25, 2023

I think presets are better than performance selections, because LCM performance choices have the potential to lock parameters.

@mashb1t
Copy link
Collaborator Author

mashb1t commented Dec 25, 2023

this is also something which i struggled with in the beginning, but i decided to go for a preset as performance selections are not bound to a specific model but rather universally applicable while presets can be very specific and easier extended/changed by users without having to fiddle with the code.
Also, as pointed out by @xhoxye, SDXL Turbo allows for a bit of experimentation, which would be prevented when locking parameters.
EDIT: While some SDXL Turbo models, like the one from SAI, will work best with 512x512 and 1-4 steps, Dreamshaper XL Turbo works with 1024x1024 and 3-10 steps, while 6 is the perfect sweet spot for quality and speed.
This is why i think a preset is better than a performance selection in this case.

@lllyasviel
Copy link
Owner

hardcoding Turbo into project codebase is still under license investigation since some online commercial service also use fooocus for common users wheras Turbo is kind of NC model

@RahulVivekNair
Copy link

hardcoding Turbo into project codebase is still under license investigation since some online commercial service also use fooocus for common users wheras Turbo is kind of NC model

Any update on this? A turbo preset would make it so much easier to work with the new dreamshaper model.

@mashb1t
Copy link
Collaborator Author

mashb1t commented Feb 8, 2024

hardcoding Turbo into project codebase is still under license investigation since some online commercial service also use fooocus for common users wheras Turbo is kind of NC model

Any update on this? A turbo preset would make it so much easier to work with the new dreamshaper model.

@RahulVivekNair as you can see there isnt yet an update on the matter. Feel free to use the preset locally or use my fork https://github.com/mashb1t/Fooocus, where the feature has already been merged.

@mashb1t mashb1t added the Size S small change, basically no testing needed label Feb 9, 2024
@RahulVivekNair
Copy link

hardcoding Turbo into project codebase is still under license investigation since some online commercial service also use fooocus for common users wheras Turbo is kind of NC model

Any update on this? A turbo preset would make it so much easier to work with the new dreamshaper model.

@RahulVivekNair as you can see there isnt yet an update on the matter. Feel free to use the preset locally or use my fork https://github.com/mashb1t/Fooocus, where the feature has already been merged.

Switched to your fork, works quite well thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size S small change, basically no testing needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for SDXL Turbo
5 participants