cwhuh commited on
Commit
52d2817
·
1 Parent(s): 474f4f9

rollback : app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -24
app.py CHANGED
@@ -42,14 +42,11 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
42
  seed = random.randint(0, MAX_SEED)
43
  generator = torch.Generator().manual_seed(seed)
44
 
45
- if refine_prompt:
46
- refined_prompt = run_gemini(
47
- target_prompt=prompt,
48
- prompt_in_path="prompt.json",
49
- )
50
- print(f"Refined prompt: {refined_prompt}")
51
- else:
52
- refined_prompt = prompt
53
 
54
  for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
55
  prompt=refined_prompt,
@@ -80,7 +77,7 @@ with gr.Blocks(css=css) as demo:
80
 
81
  with gr.Column(elem_id="col-container"):
82
  gr.Markdown(f"""# [POSTECH] PONIX Generator 🌊
83
- ([based on FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md))
84
  """)
85
 
86
  with gr.Row():
@@ -91,27 +88,23 @@ with gr.Blocks(css=css) as demo:
91
  max_lines=1,
92
  placeholder="Enter your prompt",
93
  container=False,
94
- )
95
 
96
  run_button = gr.Button("Run", scale=0)
97
 
98
  result = gr.Image(label="Result", show_label=False)
99
 
100
  with gr.Accordion("Advanced Settings", open=False):
101
-
102
- with gr.Row():
103
-
104
- refine_prompt = gr.Checkbox(label="Refine prompt", value=True)
105
-
106
- seed = gr.Slider(
107
- label="Seed",
108
- minimum=0,
109
- maximum=MAX_SEED,
110
- step=1,
111
- value=0,
112
- )
113
-
114
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
115
 
116
  with gr.Row():
117
 
 
42
  seed = random.randint(0, MAX_SEED)
43
  generator = torch.Generator().manual_seed(seed)
44
 
45
+ refined_prompt = run_gemini(
46
+ target_prompt=prompt,
47
+ prompt_in_path="prompt.json",
48
+ )
49
+ print(f"Refined prompt: {refined_prompt}")
 
 
 
50
 
51
  for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
52
  prompt=refined_prompt,
 
77
 
78
  with gr.Column(elem_id="col-container"):
79
  gr.Markdown(f"""# [POSTECH] PONIX Generator 🌊
80
+ [[non-commercial license](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md)] [[blog](https://blackforestlabs.ai/announcing-black-forest-labs/)] [[model](https://huggingface.co/black-forest-labs/FLUX.1-dev)]
81
  """)
82
 
83
  with gr.Row():
 
88
  max_lines=1,
89
  placeholder="Enter your prompt",
90
  container=False,
91
+ )
92
 
93
  run_button = gr.Button("Run", scale=0)
94
 
95
  result = gr.Image(label="Result", show_label=False)
96
 
97
  with gr.Accordion("Advanced Settings", open=False):
98
+
99
+ seed = gr.Slider(
100
+ label="Seed",
101
+ minimum=0,
102
+ maximum=MAX_SEED,
103
+ step=1,
104
+ value=0,
105
+ )
106
+
107
+ randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
 
 
 
 
108
 
109
  with gr.Row():
110