Spaces:
Sleeping
Sleeping
Update app.py
Browse files6 unmodified lines7891011121352 unmodified lines666768697071729 unmodified lines82838485868788899091921 unmodified line94959697989910021 unmodified lines1221231241251261271281 unmodified line1301311321331341351362 unmodified lines1391401411421431446 unmodified linesimport torchdevice = "cuda" if torch.cuda.is_available() else "cpu"model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to useif torch.cuda.is_available():torch_dtype = torch.float1652 unmodified lineswith gr.Blocks(css=css) as demo:with gr.Column(elem_id="col-container"):gr.Markdown(" # Text-to-Image Gradio Template")with gr.Row():prompt = gr.Text(9 unmodified linesresult = gr.Image(label="Result", show_label=False)with gr.Accordion("Advanced Settings", open=False):negative_prompt = gr.Text(label="Negative prompt",max_lines=1,placeholder="Enter a negative prompt",visible=False,)seed = gr.Slider(1 unmodified lineminimum=0,maximum=MAX_SEED,step=1,value=0,)randomize_seed = gr.Checkbox(label="Randomize seed", value=True)21 unmodified linesminimum=0.0,maximum=10.0,step=0.1,value=0.0, # Replace with defaults that work for your model)num_inference_steps = gr.Slider(1 unmodified lineminimum=1,maximum=50,step=1,value=2, # Replace with defaults that work for your model)gr.Examples(examples=examples, inputs=[prompt])2 unmodified linesfn=infer,inputs=[prompt,negative_prompt,seed,randomize_seed,6 unmodified lines789101112131452 unmodified lines676869707172739 unmodified lines83848586878889909192939495969798991001011 unmodified line10310410510610710810921 unmodified lines1311321331341351361371 unmodified line1391401411421431441452 unmodified lines1481491501511521531546 unmodified linesimport torchdevice = "cuda" if torch.cuda.is_available() else "cpu"#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 lineswith gr.Blocks(css=css) as demo:with gr.Column(elem_id="col-container"):gr.Markdown(" # Text-to-Image SemaSci Template")with gr.Row():prompt = gr.Text(9 unmodified linesresult = 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=True,)seed = gr.Slider(1 unmodified lineminimum=0,maximum=MAX_SEED,step=1,value=42,)randomize_seed = gr.Checkbox(label="Randomize seed", value=True)21 unmodified linesminimum=0.0,maximum=10.0,step=0.1,value=7.0, # Replace with defaults that work for your model)num_inference_steps = gr.Slider(1 unmodified lineminimum=1,maximum=50,step=1,value=20, # Replace with defaults that work for your model)gr.Examples(examples=examples, inputs=[prompt])2 unmodified linesfn=infer,inputs=[prompt,model_repo_id,negative_prompt,seed,randomize_seed,
app.py+16-6