Spaces:
Sleeping
Sleeping
Update app.py
Browse files6 unmodified lines78910101112131452 unmodified lines67686969707172739 unmodified lines8384858687888990919293949596978998991001011 unmodified line1031041059710610710810921 unmodified lines1311321331251341351361371 unmodified line1391401411331421431441452 unmodified lines1481491501511521531546 unmodified linesimport torch
device = "cuda" if torch.cuda.is_available() else "cpu"model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to use#model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to usemodel_repo_id = "CompVis/stable-diffusion-v1-4"
if torch.cuda.is_available(): torch_dtype = torch.float1652 unmodified lines
with gr.Blocks(css=css) as demo: with gr.Column(elem_id="col-container"): gr.Markdown(" # Text-to-Image Gradio Template") gr.Markdown(" # Text-to-Image SemaSci Template")
with gr.Row(): prompt = gr.Text(9 unmodified lines result = gr.Image(label="Result", show_label=False)
with gr.Accordion("Advanced Settings", open=False): model_repo_id = gr.Text( label="Model Id", max_lines=1, placeholder="Choose model", visible=True, container=True, ) negative_prompt = gr.Text( label="Negative prompt", max_lines=1, placeholder="Enter a negative prompt", visible=False, visible=True, )
seed = gr.Slider(1 unmodified line minimum=0, maximum=MAX_SEED, step=1, value=0, value=42, )
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)21 unmodified lines minimum=0.0, maximum=10.0, step=0.1, value=0.0, # Replace with defaults that work for your model value=7.0, # Replace with defaults that work for your model )
num_inference_steps = gr.Slider(1 unmodified line minimum=1, maximum=50, step=1, value=2, # Replace with defaults that work for your model value=20, # Replace with defaults that work for your model )
gr.Examples(examples=examples, inputs=[prompt])2 unmodified lines fn=infer, inputs=[ prompt, model_repo_id, negative_prompt, seed, randomize_seed,app.py+16-6