No description provided.
Owner

i modify find_model_list() to return 2 variables so this modification won't work

I see.

John6666 changed pull request status to closed
Owner
This comment has been hidden

you have to create a secret variable "p"

I learned about it for the first time!
I thought it kind of started up, but I thought it was subtle and weird. But I'm glad it's not a bug (I made). 🤗

and thank you for all the work you do by modifying this space and by uploading all those models.

You're welcome.
Actually, like HF Diffusion and my space, it's based on TestGen, so I could use the same code.
Basically, I'm just uploading the models almost I want and some requested. Use it as much as you want.
The speed of release is much faster than expected, though, and I haven't had time to try them!

See you.

Owner

if you want to get rid of the password, replace in app3.py:

def test_pass(test):
if test==os.getenv('p'):
print("ok")
return gr.Dropdown(label="test Model", show_label=False, choices=list(models_test) , allow_custom_value=True)
else:
print("nop")
return gr.Dropdown(label="test Model", show_label=False, choices=list([]) , allow_custom_value=True)

def test_pass_aff(test):
if test==os.getenv('p'):
return gr.Accordion("stuffs", open=True, visible=True)
else:
return gr.Accordion("stuffs", open=True, visible=False)

by :

def test_pass(test):
return gr.Dropdown(label="test Model", show_label=False, choices=list(models_test) , allow_custom_value=True)

def test_pass_aff(test):
return gr.Accordion("stuffs", open=True, visible=True)

and click one time on th bottom button.

or just create the secret variable "p" with your new password

I made a note of it in the file I have with me.
I'll give it a try.

I tried. At first it didn't change and I thought, “Huh? but when I put in the password (empty this time) and click on it, it transforms.
So that's the true form.

^^ the interface is not intuitive because it was only do for me but if you want a quick tour :
first select a tag in the second list, after chose a group of models in the first list. (20 models by group and each model use 2 time for 40 images in total)
after that ,in "Models actu" you can see the list of the models load in this group
in "List Models Perso" you can creat a list up to 40 models that can be load . ( the format is the same as Models actu. )
ex:
"John6666/uncanny-valley-v3ani-sdxl",
"John6666/fluffy-tart-xl-v16-sdxl",
"John6666/4thlyco-merges-tko-tk4-sdxl",
"John6666/4thlyco-merges-tcs-tc4-sdxl",
in Search in you can search all the models with a given string ( ex : 4thlyco and you have all the models with 4thlyco in it name) or you can search a tag and see all the models with this tag ( but the tag must by case perfect ex: anime)
and in search info you can see all the tags for a given model ( ex: "John6666/4thlyco-merges-tko-tk4-sdxl" ) the model must be given between cote .
i hope it's usefull.

sorry if my english is a bit broken

tag must by case perfect

Why not use .tolower()?
https://docs.python.org/3/library/stdtypes.html#string-methods

sorry if my english is a bit broken

Don't worry, I'm powered by DeepL too!🤢

Owner

good idea. it's just because it's was not create for release i just do with the little things instead of try hard 1 hour for just 1 minutes of time gain on the user side ^^
i'm just a beginner programmer so each modification take time

Owner

by the way did you know how to use negative prompt a size custom without using :

task = asyncio.create_task(asyncio.to_thread(models_load[model_str].fn,
                           prompt=f'{prompt} {noise}', negative_prompt=nprompt, **kwargs, token=HF_TOKEN))

i dont need the async thing but i can't find a way to just pass the parameters oser than the prompt in models_load

a size custom

What exactly is size customization?
By the way, do you speak Japanese by any chance?

i can't find a way to just pass the parameters oser than the prompt in models_load

It doesn't exist from the beginning!
So I took Gradio's external.py and modified it.
Asynchronous is only necessary in case of simultaneous generation, and originally I don't want to use it because I'm not good at asynchronous either, but I had no choice.

Owner

By the way, do you speak Japanese by any chance?

no i'm french (but i know some word by watching anime ^^)

What exactly is size customization?

i'm talking height and width

It doesn't exist from the beginning!
So I took Gradio's external.py and modified it.

ok , i'll look and just try what i can.
thank you for the help.

no i'm french (but i know some word by watching anime ^^)

I see, so that's why AA is a bit Japanese. Then I'll do something with the power of DeepL!

i'm talking height and width

I understood. It is possible. In fact, negative_prompt can also be put in kwargs (actually just a Pyhton dictionary type, whatever the name is, like moge), and other parameters can be removed from kwargs.
I'll bring something to explain, just wait a bit.

Maybe like this.

    kwargs = {} # just a dictionary
    #if height is not None and height >= 256: kwargs["height"] = height # If you want to specify manually, delete or comment out or modify this line.
    if height is None or height < 256: height = 1024  # Fix strange values when they come in. An unavoidable workaround for the bug that Gradio cannot specify None.
    #if width is not None and width >= 256: kwargs["width"] = width # If you want to specify manually, delete or... this line.
    if width is None or width < 256: width = 1024  # Fix strange values when they come in. An unavoidable workaround for the bug that Gradio cannot specify None.
    #if steps is not None and steps >= 1: kwargs["num_inference_steps"] = steps # If you want to specify "num_inference_steps" manually, delete or... this line.
    if steps is None or steps < 1: steps = 28 # Fix strange values when they come in. An unavoidable workaround for the bug that Gradio cannot specify None.
    #if cfg is not None and cfg > 0: cfg = kwargs["guidance_scale"] = cfg # If you want to specify "guidance_scale" manually, delete or... this line.
    if cfg is None or cfg == 0: cfg = 7.0 # Fix strange values when they come in. An unavoidable workaround for the bug that Gradio cannot specify None.
task = asyncio.create_task(asyncio.to_thread(models_load[model_str].fn,
                           prompt=f'{prompt} {noise}', negative_prompt=nprompt, height=height, width=width, num_inference_steps=steps, guidance_scale=cfg, **kwargs, token=HF_TOKEN))

HF Inference Parameters

https://huggingface.co/docs/api-inference/detailed_parameters
https://huggingface.co/docs/huggingface_hub/package_reference/inference_client

args and kwargs of Python

https://www.digitalocean.com/community/tutorials/how-to-use-args-and-kwargs-in-python-3
https://stackoverflow.com/questions/3394835/use-of-args-and-kwargs
https://www.reddit.com/r/learnpython/comments/v506mg/usage_of_args_and_kwargs/

I think kwargs are somewhat difficult to understand.
But in the end, this method is just a way of storing parameters that are too complicated to write, or parameters that cannot be determined in advance whether they exist or not, in a dictionary.
In the case of args, it is in a list.

In the example above, height=None would cause an error, but if the kwargs content just has no "height", there would be no error and no malfunction. That is why they are often used in libraries.

Owner

ok i'll look more into it.
my brain can't follow at this hour ( it's almost 3 AM in france)

i'll read the doc tomorrow and try and retry until it work .

thank you again for your time.
have a good day

Oh, that must be sleepy.
Good night.

Sign up or log in to comment