Niki Zhang commited on
Commit
2fe62fc
·
verified ·
1 Parent(s): d60d818

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +75 -75
app.py CHANGED
@@ -742,7 +742,7 @@ async def submit_caption(state, text_refiner, length, sentiment, factuality, lan
742
  print("input_points_state",input_points_state)
743
  print("input_labels_state",input_labels_state)
744
 
745
- prompt=generate_prompt(paragraph,focus_type,length,sentiment,factuality,language)
746
 
747
  print("Prompt:", prompt)
748
  print("click",click_index)
@@ -1411,82 +1411,82 @@ def create_ui():
1411
 
1412
  with gr.Row(variant="panel") as text2image_model:
1413
 
1414
- with gr.Column(scale=0.4):
1415
- with gr.Column():
1416
- gr.Radio([artist], label="Artist", info="Who is the artist?🧑‍🎨"),
1417
- gr.Radio(["Oil Painting","Printmaking","Watercolor Painting","Drawing"], label="Art Forms", info="What are the art forms?🎨"),
1418
- gr.Radio(["Renaissance", "Baroque", "Impressionism","Modernism"], label="Period", info="Which art period?⏳"),
1419
- # to be done
1420
- gr.Dropdown(
1421
- ["ran", "swam", "ate", "slept"], value=["swam", "slept"], multiselect=True, label="Items", info="Which items are you interested in?"
1422
- )
1423
 
1424
- with gr.Row():
1425
- prompt = gr.Text(
1426
- label="Prompt",
1427
- show_label=False,
1428
- max_lines=1,
1429
- placeholder="Enter your prompt",
1430
- container=False,
1431
- )
1432
- run_button = gr.Button("Run", scale=0)
1433
 
1434
- with gr.Accordion("Advanced options", open=True):
1435
- num_images = gr.Slider(
1436
- label="Number of Images",
1437
- minimum=1,
1438
- maximum=4,
1439
- step=1,
1440
- value=4,
1441
- )
1442
- with gr.Row():
1443
- use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
1444
- negative_prompt = gr.Text(
1445
- label="Negative prompt",
1446
- max_lines=5,
1447
- lines=4,
1448
- placeholder="Enter a negative prompt",
1449
- value="(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, NSFW",
1450
- visible=True,
1451
- )
1452
- seed = gr.Slider(
1453
- label="Seed",
1454
- minimum=0,
1455
- maximum=MAX_SEED,
1456
- step=1,
1457
- value=0,
1458
- )
1459
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
1460
- with gr.Row(visible=True):
1461
- width = gr.Slider(
1462
- label="Width",
1463
- minimum=100,
1464
- maximum=MAX_IMAGE_SIZE,
1465
- step=64,
1466
- value=1024,
1467
- )
1468
- height = gr.Slider(
1469
- label="Height",
1470
- minimum=100,
1471
- maximum=MAX_IMAGE_SIZE,
1472
- step=64,
1473
- value=1024,
1474
- )
1475
- with gr.Row():
1476
- guidance_scale = gr.Slider(
1477
- label="Guidance Scale",
1478
- minimum=0.1,
1479
- maximum=6,
1480
- step=0.1,
1481
- value=3.0,
1482
- )
1483
- num_inference_steps = gr.Slider(
1484
- label="Number of inference steps",
1485
- minimum=1,
1486
- maximum=15,
1487
- step=1,
1488
- value=8,
1489
- )
1490
  with gr.Column(scale=0.6):
1491
  result = gr.Gallery(
1492
  label="Result",
 
742
  print("input_points_state",input_points_state)
743
  print("input_labels_state",input_labels_state)
744
 
745
+ prompt=generate_prompt(focus_type,paragraph,length,sentiment,factuality,language)
746
 
747
  print("Prompt:", prompt)
748
  print("click",click_index)
 
1411
 
1412
  with gr.Row(variant="panel") as text2image_model:
1413
 
1414
+ # with gr.Column(scale=0.4):
1415
+ # with gr.Column():
1416
+ # gr.Radio([artist], label="Artist", info="Who is the artist?🧑‍🎨"),
1417
+ # gr.Radio(["Oil Painting","Printmaking","Watercolor Painting","Drawing"], label="Art Forms", info="What are the art forms?🎨"),
1418
+ # gr.Radio(["Renaissance", "Baroque", "Impressionism","Modernism"], label="Period", info="Which art period?⏳"),
1419
+ # # to be done
1420
+ # gr.Dropdown(
1421
+ # ["ran", "swam", "ate", "slept"], value=["swam", "slept"], multiselect=True, label="Items", info="Which items are you interested in?"
1422
+ # )
1423
 
1424
+ # with gr.Row():
1425
+ # prompt = gr.Text(
1426
+ # label="Prompt",
1427
+ # show_label=False,
1428
+ # max_lines=1,
1429
+ # placeholder="Enter your prompt",
1430
+ # container=False,
1431
+ # )
1432
+ # run_button = gr.Button("Run", scale=0)
1433
 
1434
+ # with gr.Accordion("Advanced options", open=True):
1435
+ # num_images = gr.Slider(
1436
+ # label="Number of Images",
1437
+ # minimum=1,
1438
+ # maximum=4,
1439
+ # step=1,
1440
+ # value=4,
1441
+ # )
1442
+ # with gr.Row():
1443
+ # use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
1444
+ # negative_prompt = gr.Text(
1445
+ # label="Negative prompt",
1446
+ # max_lines=5,
1447
+ # lines=4,
1448
+ # placeholder="Enter a negative prompt",
1449
+ # value="(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, NSFW",
1450
+ # visible=True,
1451
+ # )
1452
+ # seed = gr.Slider(
1453
+ # label="Seed",
1454
+ # minimum=0,
1455
+ # maximum=MAX_SEED,
1456
+ # step=1,
1457
+ # value=0,
1458
+ # )
1459
+ # randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
1460
+ # with gr.Row(visible=True):
1461
+ # width = gr.Slider(
1462
+ # label="Width",
1463
+ # minimum=100,
1464
+ # maximum=MAX_IMAGE_SIZE,
1465
+ # step=64,
1466
+ # value=1024,
1467
+ # )
1468
+ # height = gr.Slider(
1469
+ # label="Height",
1470
+ # minimum=100,
1471
+ # maximum=MAX_IMAGE_SIZE,
1472
+ # step=64,
1473
+ # value=1024,
1474
+ # )
1475
+ # with gr.Row():
1476
+ # guidance_scale = gr.Slider(
1477
+ # label="Guidance Scale",
1478
+ # minimum=0.1,
1479
+ # maximum=6,
1480
+ # step=0.1,
1481
+ # value=3.0,
1482
+ # )
1483
+ # num_inference_steps = gr.Slider(
1484
+ # label="Number of inference steps",
1485
+ # minimum=1,
1486
+ # maximum=15,
1487
+ # step=1,
1488
+ # value=8,
1489
+ # )
1490
  with gr.Column(scale=0.6):
1491
  result = gr.Gallery(
1492
  label="Result",