Spaces:
Running
Running
Update app.py
Browse files14 unmodified lines1516171819202143 unmodified lines6566676869707121 unmodified lines9394959697989910010110215 unmodified lines11811912012112212314 unmodified lines# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, custom=None):if prompt == "" or prompt == None:return None43 unmodified linesif model == 'CleanLinearMix':API_URL = "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw"if model == 'Custom':API_URL == f'https://api-inference.huggingface.co/models/{custom}'payload = {"inputs": prompt,21 unmodified lineswith gr.Row():text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")with gr.Row():with gr.Column():model = gr.Radio(label="Модель", value="DALL-E 3 XL", choices=models_list)with gr.Accordion(label="Custom", open=False):custom = gr.Textbox(show_label=False, placeholder="autor/model — openskyml/dalle-3-xl")15 unmodified lineswith gr.Row():image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, custom], outputs=image_output)dalle.launch(show_api=False, share=False)14 unmodified lines1516171819202143 unmodified lines6566676869707121 unmodified lines9394959697989910010110210315 unmodified lines11912012112212312414 unmodified lines# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Karras", seed=-1, customa=None, customm=None):if prompt == "" or prompt == None:return None43 unmodified linesif model == 'CleanLinearMix':API_URL = "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw"if model == 'Custom':API_URL == f'https://api-inference.huggingface.co/models/{customa}/{customm}'payload = {"inputs": prompt,21 unmodified lineswith gr.Row():text_prompt = gr.Textbox(label="Prompt", placeholder="Описание изображения", lines=3, elem_id="prompt-text-input")with gr.Row():model = gr.Radio(label="Модель", value="DALL-E 3 XL", choices=models_list)with gr.Accordion(label="Custom", open=False):with gr.Row():customa = gr.Textbox(show_label=False, placeholder="autor — openskyml")customm = gr.Textbox(show_label=False, placeholder="model — dalle-3-xl")15 unmodified lineswith gr.Row():image_output = gr.Image(type="pil", label="Изображение", elem_id="gallery")text_button.click(query, inputs=[text_prompt, model, negative_prompt, steps, cfg, method, seed, customa, customm], outputs=image_output)dalle.launch(show_api=False, share=False)
app.py+8-7