Update app.py
Browse files
app.py
CHANGED
@@ -158,19 +158,19 @@ footer {
|
|
158 |
}
|
159 |
"""
|
160 |
|
161 |
-
|
162 |
def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu",
|
163 |
offload: bool = False):
|
164 |
|
165 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
166 |
-
|
167 |
-
|
168 |
with gr.Row():
|
169 |
with gr.Column():
|
170 |
prompt = gr.Textbox(label="Prompt", value="portrait, color, cinematic")
|
171 |
id_image = gr.Image(label="ID Image")
|
172 |
id_weight = gr.Slider(0.0, 3.0, 1, step=0.05, label="id weight")
|
173 |
|
|
|
174 |
width = gr.Slider(256, 1536, 896, step=16, label="Width")
|
175 |
height = gr.Slider(256, 1536, 1152, step=16, label="Height")
|
176 |
num_steps = gr.Slider(1, 20, 20, step=1, label="Number of steps")
|
@@ -188,12 +188,13 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
|
|
188 |
timestep_to_start_cfg = gr.Slider(0, 20, 1, step=1, label="timestep to start cfg", visible=args.dev)
|
189 |
|
190 |
generate_btn = gr.Button("Generate")
|
191 |
-
|
192 |
with gr.Column():
|
193 |
output_image = gr.Image(label="Generated Image")
|
194 |
seed_output = gr.Textbox(label="Used Seed")
|
195 |
intermediate_output = gr.Gallery(label='Output', elem_id="gallery", visible=args.dev)
|
196 |
-
|
|
|
197 |
|
198 |
with gr.Row(), gr.Column():
|
199 |
gr.Markdown("## Examples")
|
@@ -266,7 +267,6 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
|
|
266 |
|
267 |
return demo
|
268 |
|
269 |
-
|
270 |
if __name__ == "__main__":
|
271 |
import argparse
|
272 |
|
@@ -285,4 +285,4 @@ if __name__ == "__main__":
|
|
285 |
huggingface_hub.login(os.getenv('HF_TOKEN'))
|
286 |
|
287 |
demo = create_demo(args, args.name, args.device, args.offload)
|
288 |
-
demo.launch()
|
|
|
158 |
}
|
159 |
"""
|
160 |
|
|
|
161 |
def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu",
|
162 |
offload: bool = False):
|
163 |
|
164 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
165 |
+
|
166 |
+
|
167 |
with gr.Row():
|
168 |
with gr.Column():
|
169 |
prompt = gr.Textbox(label="Prompt", value="portrait, color, cinematic")
|
170 |
id_image = gr.Image(label="ID Image")
|
171 |
id_weight = gr.Slider(0.0, 3.0, 1, step=0.05, label="id weight")
|
172 |
|
173 |
+
|
174 |
width = gr.Slider(256, 1536, 896, step=16, label="Width")
|
175 |
height = gr.Slider(256, 1536, 1152, step=16, label="Height")
|
176 |
num_steps = gr.Slider(1, 20, 20, step=1, label="Number of steps")
|
|
|
188 |
timestep_to_start_cfg = gr.Slider(0, 20, 1, step=1, label="timestep to start cfg", visible=args.dev)
|
189 |
|
190 |
generate_btn = gr.Button("Generate")
|
191 |
+
|
192 |
with gr.Column():
|
193 |
output_image = gr.Image(label="Generated Image")
|
194 |
seed_output = gr.Textbox(label="Used Seed")
|
195 |
intermediate_output = gr.Gallery(label='Output', elem_id="gallery", visible=args.dev)
|
196 |
+
# _CITE_ 관련 부분 제거
|
197 |
+
|
198 |
|
199 |
with gr.Row(), gr.Column():
|
200 |
gr.Markdown("## Examples")
|
|
|
267 |
|
268 |
return demo
|
269 |
|
|
|
270 |
if __name__ == "__main__":
|
271 |
import argparse
|
272 |
|
|
|
285 |
huggingface_hub.login(os.getenv('HF_TOKEN'))
|
286 |
|
287 |
demo = create_demo(args, args.name, args.device, args.offload)
|
288 |
+
demo.launch()
|