huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
23.94k stars 4.93k forks source link

How to input gradio settings in Python #7775

Open levoz92 opened 2 months ago

levoz92 commented 2 months ago

Hi.

I use realisticStockPhoto_v20 on Fooocus with sdxl_film_photography_style lora and I really like the results. Fooocus and other gradio implementations come with settings inputs that I want to utilize in Python as well. In particular, if this is my code:

device = "cuda"
model_path = "weights/realisticStockPhoto_v20.safetensors"

pipe = StableDiffusionXLInpaintPipeline.from_single_file(
    model_path, 
    torch_dtype=torch.float16, 
    num_in_channels=4).to(device)

pipe.load_lora_weights(".", weight_name="weights/SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors", adapter_name="film")

how can I set the following settings/parameters in code?

tolgacangoz commented 2 months ago

I strongly recommend you examine the docs page for that pipeline.

levoz92 commented 2 months ago

I strongly recommend you examine the docs page for that pipeline.

Definitely will do. Thanks.

But just a cursory overview, I don't see a lot of what I listed in the documentation. Nothing about Preset, Performance, Style, Base, Refiner.

tolgacangoz commented 2 months ago

I think "performance" can be arranged with num_inference_steps and strength. You can search "refiner" in the search bar on the docs page to see all the examples in the diffusers. The styles seem special for Fooocus; they should be adaptable here as well. Idk about preset. A more knowledgeble may answer you.