Aarifkhan commited on
Commit
aaecba9
1 Parent(s): b4ef37a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -6
app.py CHANGED
@@ -110,10 +110,22 @@ css = """
110
  }
111
  """
112
 
113
- demo = gr.Interface(generate_txt2img,
114
- inputs=["text", "checkbox", gr.inputs.Dropdown(["None style", "Cinematic", "Digital Art", "Portrait"], label="Select Style")],
115
- outputs="image",
116
- title="PixelCraft",
117
- css=css)
 
118
 
119
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
  """
112
 
113
+ with gr.Blocks(css=css) as demo:
114
+ with gr.Row():
115
+ with gr.Column():
116
+ gr.Markdown("<h1>NSFW-GEN</h1>")
117
+ text_prompt = gr.Textbox(label="Enter Prompt", placeholder="Example: a cute dog", lines=2)
118
+ generate_button = gr.Button("Generate Image", variant='primary')
119
 
120
+ with gr.Column():
121
+ gr.Markdown("<h4>Advanced Settings</h4>")
122
+ with gr.Accordion("Advanced Customizations", open=False):
123
+ negative_prompt = gr.Textbox(label="Negative Prompt (Optional)", placeholder="Example: blurry, unfocused", lines=2)
124
+ image_style = gr.Dropdown(label="Select Style", choices=["None style", "Cinematic", "Digital Art", "Portrait"], value="None style")
125
+
126
+ with gr.Row():
127
+ image_output = gr.Image(type="pil", label="Output Image")
128
+
129
+ generate_button.click(generate_txt2img, inputs=[current_model, text_prompt, negative_prompt, image_style], outputs=image_output)
130
+
131
+ demo.launch()