Spaces:
Running
on
Zero
Running
on
Zero
liujie31
commited on
Commit
·
50f0b00
1
Parent(s):
8274b42
first commit
Browse files- app.py +255 -0
- model_call_counter.txt +1 -0
- prompts/geneval.txt +473 -0
- prompts/ocr.txt +0 -0
- prompts/pickscore.txt +0 -0
- requirements.txt +8 -0
app.py
ADDED
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
+
import random
|
4 |
+
from PIL import Image
|
5 |
+
import os
|
6 |
+
|
7 |
+
# import spaces
|
8 |
+
from diffusers import StableDiffusion3Pipeline
|
9 |
+
import torch
|
10 |
+
from peft import PeftModel
|
11 |
+
|
12 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
13 |
+
model_repo_id = "frankjoshua/stable-diffusion-3.5-medium"
|
14 |
+
|
15 |
+
if torch.cuda.is_available():
|
16 |
+
torch_dtype = torch.float16
|
17 |
+
else:
|
18 |
+
torch_dtype = torch.float32
|
19 |
+
|
20 |
+
pipe = StableDiffusion3Pipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
21 |
+
|
22 |
+
MAX_SEED = np.iinfo(np.int32).max
|
23 |
+
MAX_IMAGE_SIZE = 1024
|
24 |
+
|
25 |
+
lora_models = {
|
26 |
+
"None": None,
|
27 |
+
"GenEval": "jieliu/SD3.5M-FlowGRPO-GenEval",
|
28 |
+
"Text Rendering": "jieliu/SD3.5M-FlowGRPO-Text",
|
29 |
+
"Human Prefer": "jieliu/SD3.5M-FlowGRPO-PickScore",
|
30 |
+
}
|
31 |
+
|
32 |
+
lora_prompts = {
|
33 |
+
"GenEval": os.path.join(os.getcwd(), "prompts/geneval.txt"),
|
34 |
+
"Text Rendering": os.path.join(os.getcwd(), "prompts/ocr.txt"),
|
35 |
+
"Human Prefer": os.path.join(os.getcwd(), "prompts/pickscore.txt"),
|
36 |
+
}
|
37 |
+
|
38 |
+
pipe.transformer = PeftModel.from_pretrained(pipe.transformer, lora_models["GenEval"], adapter_name="GenEval")
|
39 |
+
pipe.transformer.load_adapter(lora_models["Text Rendering"], adapter_name="Text Rendering")
|
40 |
+
pipe.transformer.load_adapter(lora_models["Human Prefer"], adapter_name="Human Prefer")
|
41 |
+
pipe = pipe.to(device)
|
42 |
+
|
43 |
+
COUNTER_FILE = os.path.join(os.getcwd(),"model_call_counter.txt")
|
44 |
+
|
45 |
+
def get_call_count():
|
46 |
+
if not os.path.exists(COUNTER_FILE):
|
47 |
+
return 0
|
48 |
+
try:
|
49 |
+
with open(COUNTER_FILE, 'r') as f:
|
50 |
+
return int(f.read().strip())
|
51 |
+
except:
|
52 |
+
return 0
|
53 |
+
|
54 |
+
def update_call_count():
|
55 |
+
count = get_call_count() + 1
|
56 |
+
with open(COUNTER_FILE, 'w') as f:
|
57 |
+
f.write(str(count))
|
58 |
+
return count
|
59 |
+
|
60 |
+
def sample_prompt(lora_model):
|
61 |
+
if lora_model in lora_models and lora_model != "None":
|
62 |
+
file_path = f"{lora_prompts[lora_model]}"
|
63 |
+
try:
|
64 |
+
with open(file_path, 'r') as file:
|
65 |
+
prompts = file.readlines()
|
66 |
+
return random.choice(prompts).strip()
|
67 |
+
except FileNotFoundError:
|
68 |
+
return "Prompt file not found."
|
69 |
+
return ""
|
70 |
+
|
71 |
+
def create_grid_image(images):
|
72 |
+
# Create a 2x2 grid from the 4 images
|
73 |
+
width, height = images[0].size
|
74 |
+
grid_image = Image.new('RGB', (width * 2, height * 2))
|
75 |
+
|
76 |
+
# Paste images in a 2x2 grid
|
77 |
+
grid_image.paste(images[0], (0, 0))
|
78 |
+
grid_image.paste(images[1], (width, 0))
|
79 |
+
grid_image.paste(images[2], (0, height))
|
80 |
+
grid_image.paste(images[3], (width, height))
|
81 |
+
|
82 |
+
return grid_image
|
83 |
+
|
84 |
+
# @spaces.GPU #[uncomment to use ZeroGPU]
|
85 |
+
def infer(
|
86 |
+
prompt,
|
87 |
+
seed,
|
88 |
+
randomize_seed,
|
89 |
+
width,
|
90 |
+
height,
|
91 |
+
guidance_scale,
|
92 |
+
num_inference_steps,
|
93 |
+
lora_model,
|
94 |
+
progress=gr.Progress(track_tqdm=True),
|
95 |
+
):
|
96 |
+
call_count = update_call_count()
|
97 |
+
|
98 |
+
images = []
|
99 |
+
seeds = []
|
100 |
+
|
101 |
+
# Generate 4 images
|
102 |
+
for i in range(4):
|
103 |
+
if randomize_seed:
|
104 |
+
current_seed = random.randint(0, MAX_SEED)
|
105 |
+
else:
|
106 |
+
current_seed = seed + i # Use sequential seeds if not randomizing
|
107 |
+
|
108 |
+
seeds.append(current_seed)
|
109 |
+
generator = torch.Generator().manual_seed(current_seed)
|
110 |
+
sampled_prompt = sample_prompt(lora_model)
|
111 |
+
final_prompt = prompt if prompt else sampled_prompt
|
112 |
+
|
113 |
+
if lora_model == "None":
|
114 |
+
with pipe.transformer.disable_adapter():
|
115 |
+
image = pipe(
|
116 |
+
prompt=final_prompt,
|
117 |
+
negative_prompt="",
|
118 |
+
guidance_scale=guidance_scale,
|
119 |
+
num_inference_steps=num_inference_steps,
|
120 |
+
width=width,
|
121 |
+
height=height,
|
122 |
+
generator=generator,
|
123 |
+
).images[0]
|
124 |
+
else:
|
125 |
+
pipe.transformer.set_adapter(lora_model)
|
126 |
+
image = pipe(
|
127 |
+
prompt=final_prompt,
|
128 |
+
negative_prompt="",
|
129 |
+
guidance_scale=guidance_scale,
|
130 |
+
num_inference_steps=num_inference_steps,
|
131 |
+
width=width,
|
132 |
+
height=height,
|
133 |
+
generator=generator,
|
134 |
+
).images[0]
|
135 |
+
|
136 |
+
images.append(image)
|
137 |
+
|
138 |
+
# Create a 2x2 grid from the 4 images
|
139 |
+
grid_image = create_grid_image(images)
|
140 |
+
|
141 |
+
return grid_image, ", ".join(map(str, seeds)), f"Model has been called {call_count} times"
|
142 |
+
|
143 |
+
|
144 |
+
css = """
|
145 |
+
#col-container {
|
146 |
+
margin: 0 auto;
|
147 |
+
max-width: 640px;
|
148 |
+
}
|
149 |
+
"""
|
150 |
+
|
151 |
+
with gr.Blocks(css=css) as demo:
|
152 |
+
with gr.Column(elem_id="col-container"):
|
153 |
+
gr.Markdown(" # SD3.5 Medium+Flow-GRPO\n\nOur model is trained separately for different tasks, so it's best to choose the corresponding prompt format for each task.\n\n**User Guide:**\n1. Select a LoRA Model (choose 'None' for the base model)\n2. Click 'Sample Prompt' to randomly select from ~1000 task-specific prompts, or write your own\n3. Click 'Run' to generate images (generates a 2×2 grid of 4 images)")
|
154 |
+
|
155 |
+
with gr.Row():
|
156 |
+
prompt = gr.Textbox(
|
157 |
+
label="Prompt",
|
158 |
+
show_label=False,
|
159 |
+
max_lines=1,
|
160 |
+
placeholder="Enter your prompt",
|
161 |
+
container=False,
|
162 |
+
)
|
163 |
+
|
164 |
+
with gr.Row():
|
165 |
+
lora_model = gr.Dropdown(
|
166 |
+
label="LoRA Model",
|
167 |
+
choices=list(lora_models.keys()),
|
168 |
+
value="None"
|
169 |
+
)
|
170 |
+
|
171 |
+
sample_prompt_button = gr.Button("Sample Prompt", scale=0, variant="secondary")
|
172 |
+
|
173 |
+
def update_sampled_prompt(lora_model):
|
174 |
+
return sample_prompt(lora_model)
|
175 |
+
|
176 |
+
sample_prompt_button.click(
|
177 |
+
fn=update_sampled_prompt,
|
178 |
+
inputs=[lora_model],
|
179 |
+
outputs=[prompt]
|
180 |
+
)
|
181 |
+
|
182 |
+
run_button = gr.Button("Run", scale=0, variant="primary")
|
183 |
+
|
184 |
+
|
185 |
+
result = gr.Image(label="Results (2x2 Grid)", show_label=True)
|
186 |
+
seed_display = gr.Textbox(label="Seeds Used", show_label=True)
|
187 |
+
|
188 |
+
with gr.Accordion("Advanced Settings", open=False):
|
189 |
+
seed = gr.Slider(
|
190 |
+
label="Starting Seed",
|
191 |
+
minimum=0,
|
192 |
+
maximum=MAX_SEED,
|
193 |
+
step=1,
|
194 |
+
value=0,
|
195 |
+
)
|
196 |
+
|
197 |
+
randomize_seed = gr.Checkbox(label="Randomize seeds", value=True)
|
198 |
+
|
199 |
+
with gr.Row():
|
200 |
+
width = gr.Slider(
|
201 |
+
label="Width",
|
202 |
+
minimum=256,
|
203 |
+
maximum=MAX_IMAGE_SIZE,
|
204 |
+
step=32,
|
205 |
+
value=512, # Replace with defaults that work for your model
|
206 |
+
)
|
207 |
+
|
208 |
+
height = gr.Slider(
|
209 |
+
label="Height",
|
210 |
+
minimum=256,
|
211 |
+
maximum=MAX_IMAGE_SIZE,
|
212 |
+
step=32,
|
213 |
+
value=512, # Replace with defaults that work for your model
|
214 |
+
)
|
215 |
+
|
216 |
+
with gr.Row():
|
217 |
+
guidance_scale = gr.Slider(
|
218 |
+
label="Guidance scale",
|
219 |
+
minimum=0.0,
|
220 |
+
maximum=10.0,
|
221 |
+
step=0.1,
|
222 |
+
value=4.5, # Replace with defaults that work for your model
|
223 |
+
)
|
224 |
+
|
225 |
+
num_inference_steps = gr.Slider(
|
226 |
+
label="Number of inference steps",
|
227 |
+
minimum=1,
|
228 |
+
maximum=50,
|
229 |
+
step=1,
|
230 |
+
value=40, # Replace with defaults that work for your model
|
231 |
+
)
|
232 |
+
|
233 |
+
call_count_display = gr.Textbox(
|
234 |
+
label="Model Call Count",
|
235 |
+
value=f"Model has been called {get_call_count()} times",
|
236 |
+
interactive=False
|
237 |
+
)
|
238 |
+
gr.on(
|
239 |
+
triggers=[run_button.click, prompt.submit],
|
240 |
+
fn=infer,
|
241 |
+
inputs=[
|
242 |
+
prompt,
|
243 |
+
seed,
|
244 |
+
randomize_seed,
|
245 |
+
width,
|
246 |
+
height,
|
247 |
+
guidance_scale,
|
248 |
+
num_inference_steps,
|
249 |
+
lora_model,
|
250 |
+
],
|
251 |
+
outputs=[result, seed_display, call_count_display],
|
252 |
+
)
|
253 |
+
|
254 |
+
if __name__ == "__main__":
|
255 |
+
demo.launch()
|
model_call_counter.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
160
|
prompts/geneval.txt
ADDED
@@ -0,0 +1,473 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
a photo of a bench and a sports ball
|
2 |
+
a photo of a toothbrush and a snowboard
|
3 |
+
a photo of a toaster and an oven
|
4 |
+
a photo of a broccoli and a vase
|
5 |
+
a photo of a tennis racket and a wine glass
|
6 |
+
a photo of a fork and a knife
|
7 |
+
a photo of a hair drier and a cake
|
8 |
+
a photo of a horse and a giraffe
|
9 |
+
a photo of a horse and a computer keyboard
|
10 |
+
a photo of a toothbrush and a carrot
|
11 |
+
a photo of a cake and a zebra
|
12 |
+
a photo of a hair drier and a bear
|
13 |
+
a photo of a knife and a zebra
|
14 |
+
a photo of a couch and a wine glass
|
15 |
+
a photo of a frisbee and a vase
|
16 |
+
a photo of a book and a laptop
|
17 |
+
a photo of a dining table and a bear
|
18 |
+
a photo of a frisbee and a couch
|
19 |
+
a photo of a couch and a horse
|
20 |
+
a photo of a toilet and a computer mouse
|
21 |
+
a photo of a bottle and a refrigerator
|
22 |
+
a photo of a potted plant and a backpack
|
23 |
+
a photo of a skateboard and a cake
|
24 |
+
a photo of a broccoli and a parking meter
|
25 |
+
a photo of a zebra and a bed
|
26 |
+
a photo of an oven and a bed
|
27 |
+
a photo of a baseball bat and a fork
|
28 |
+
a photo of a vase and a spoon
|
29 |
+
a photo of a skateboard and a sink
|
30 |
+
a photo of a pizza and a bench
|
31 |
+
a photo of a bowl and a pizza
|
32 |
+
a photo of a tennis racket and a bird
|
33 |
+
a photo of a wine glass and a bear
|
34 |
+
a photo of a fork and a book
|
35 |
+
a photo of a scissors and a bowl
|
36 |
+
a photo of a laptop and a carrot
|
37 |
+
a photo of a stop sign and a bottle
|
38 |
+
a photo of a microwave and a truck
|
39 |
+
a photo of a person and a bear
|
40 |
+
a photo of a frisbee and a cell phone
|
41 |
+
a photo of a parking meter and a teddy bear
|
42 |
+
a photo of a tennis racket and a bicycle
|
43 |
+
a photo of a stop sign and a motorcycle
|
44 |
+
a photo of a fire hydrant and a tennis racket
|
45 |
+
a photo of a scissors and a sandwich
|
46 |
+
a photo of a pizza and a book
|
47 |
+
a photo of a giraffe and a computer mouse
|
48 |
+
a photo of a stop sign and a toaster
|
49 |
+
a photo of a computer mouse and a zebra
|
50 |
+
a photo of a chair and a bench
|
51 |
+
a photo of a tv and a carrot
|
52 |
+
a photo of a surfboard and a suitcase
|
53 |
+
a photo of a computer keyboard and a laptop
|
54 |
+
a photo of a computer keyboard and a microwave
|
55 |
+
a photo of a scissors and a bird
|
56 |
+
a photo of a person and a snowboard
|
57 |
+
a photo of a cow and a horse
|
58 |
+
a photo of a handbag and a refrigerator
|
59 |
+
a photo of a chair and a laptop
|
60 |
+
a photo of a toothbrush and a bench
|
61 |
+
a photo of a book and a baseball bat
|
62 |
+
a photo of a horse and a train
|
63 |
+
a photo of a bench and a vase
|
64 |
+
a photo of a traffic light and a backpack
|
65 |
+
a photo of a sports ball and a cow
|
66 |
+
a photo of a computer mouse and a spoon
|
67 |
+
a photo of a tv and a bicycle
|
68 |
+
a photo of a bench and a snowboard
|
69 |
+
a photo of a toothbrush and a toilet
|
70 |
+
a photo of a person and an apple
|
71 |
+
a photo of a sink and a sports ball
|
72 |
+
a photo of a stop sign and a dog
|
73 |
+
a photo of a knife and a stop sign
|
74 |
+
a photo of a wine glass and a handbag
|
75 |
+
a photo of a bowl and a skis
|
76 |
+
a photo of a frisbee and an apple
|
77 |
+
a photo of a computer keyboard and a cell phone
|
78 |
+
a photo of a stop sign and a fork
|
79 |
+
a photo of a potted plant and a boat
|
80 |
+
a photo of a tv and a cell phone
|
81 |
+
a photo of a tie and a broccoli
|
82 |
+
a photo of a potted plant and a donut
|
83 |
+
a photo of a person and a sink
|
84 |
+
a photo of a couch and a snowboard
|
85 |
+
a photo of a fork and a baseball glove
|
86 |
+
a photo of an apple and a toothbrush
|
87 |
+
a photo of a bus and a baseball glove
|
88 |
+
a photo of a person and a stop sign
|
89 |
+
a photo of a carrot and a couch
|
90 |
+
a photo of a baseball bat and a bear
|
91 |
+
a photo of a fire hydrant and a train
|
92 |
+
a photo of a baseball glove and a carrot
|
93 |
+
a photo of a microwave and a bench
|
94 |
+
a photo of a cake and a stop sign
|
95 |
+
a photo of a car and a computer mouse
|
96 |
+
a photo of a suitcase and a dining table
|
97 |
+
a photo of a person and a traffic light
|
98 |
+
a photo of a cell phone and a horse
|
99 |
+
a photo of a baseball bat and a giraffe
|
100 |
+
a photo of two clocks
|
101 |
+
a photo of two backpacks
|
102 |
+
a photo of four handbags
|
103 |
+
a photo of two frisbees
|
104 |
+
a photo of three sports balls
|
105 |
+
a photo of two bears
|
106 |
+
a photo of two ties
|
107 |
+
a photo of four sinks
|
108 |
+
a photo of two toothbrushs
|
109 |
+
a photo of three persons
|
110 |
+
a photo of three tennis rackets
|
111 |
+
a photo of four bowls
|
112 |
+
a photo of four vases
|
113 |
+
a photo of three cups
|
114 |
+
a photo of four computer keyboards
|
115 |
+
a photo of three sinks
|
116 |
+
a photo of two ovens
|
117 |
+
a photo of two toilets
|
118 |
+
a photo of two bicycles
|
119 |
+
a photo of two trains
|
120 |
+
a photo of three oranges
|
121 |
+
a photo of three buses
|
122 |
+
a photo of three handbags
|
123 |
+
a photo of three snowboards
|
124 |
+
a photo of two snowboards
|
125 |
+
a photo of four dogs
|
126 |
+
a photo of three apples
|
127 |
+
a photo of two sheeps
|
128 |
+
a photo of three hot dogs
|
129 |
+
a photo of three zebras
|
130 |
+
a photo of three kites
|
131 |
+
a photo of four apples
|
132 |
+
a photo of three cell phones
|
133 |
+
a photo of four baseball gloves
|
134 |
+
a photo of three computer keyboards
|
135 |
+
a photo of two beds
|
136 |
+
a photo of two tv remotes
|
137 |
+
a photo of three fire hydrants
|
138 |
+
a photo of three books
|
139 |
+
a photo of four giraffes
|
140 |
+
a photo of two vases
|
141 |
+
a photo of four donuts
|
142 |
+
a photo of four chairs
|
143 |
+
a photo of three baseball bats
|
144 |
+
a photo of four stop signs
|
145 |
+
a photo of two pizzas
|
146 |
+
a photo of three refrigerators
|
147 |
+
a photo of two fire hydrants
|
148 |
+
a photo of three giraffes
|
149 |
+
a photo of four tvs
|
150 |
+
a photo of three wine glasses
|
151 |
+
a photo of four broccolis
|
152 |
+
a photo of three trucks
|
153 |
+
a photo of two trucks
|
154 |
+
a photo of two carrots
|
155 |
+
a photo of two sandwichs
|
156 |
+
a photo of four traffic lights
|
157 |
+
a photo of four clocks
|
158 |
+
a photo of two cars
|
159 |
+
a photo of two bananas
|
160 |
+
a photo of two wine glasses
|
161 |
+
a photo of three pizzas
|
162 |
+
a photo of four knifes
|
163 |
+
a photo of three suitcases
|
164 |
+
a photo of four zebras
|
165 |
+
a photo of two teddy bears
|
166 |
+
a photo of four skateboards
|
167 |
+
a photo of four hot dogs
|
168 |
+
a photo of three birds
|
169 |
+
a photo of four boats
|
170 |
+
a photo of four microwaves
|
171 |
+
a photo of two hair driers
|
172 |
+
a photo of three laptops
|
173 |
+
a photo of three cows
|
174 |
+
a photo of two parking meters
|
175 |
+
a photo of four benchs
|
176 |
+
a photo of three benchs
|
177 |
+
a photo of four frisbees
|
178 |
+
a photo of four books
|
179 |
+
a photo of four buses
|
180 |
+
a photo of a blue fire hydrant
|
181 |
+
a photo of a pink car
|
182 |
+
a photo of a purple cup
|
183 |
+
a photo of a blue cow
|
184 |
+
a photo of a yellow boat
|
185 |
+
a photo of a blue umbrella
|
186 |
+
a photo of a blue elephant
|
187 |
+
a photo of a yellow elephant
|
188 |
+
a photo of a red bicycle
|
189 |
+
a photo of a purple suitcase
|
190 |
+
a photo of a purple hair drier
|
191 |
+
a photo of a white sandwich
|
192 |
+
a photo of a purple elephant
|
193 |
+
a photo of a green microwave
|
194 |
+
a photo of a red zebra
|
195 |
+
a photo of a red apple
|
196 |
+
a photo of a yellow tv remote
|
197 |
+
a photo of a blue toilet
|
198 |
+
a photo of an orange orange
|
199 |
+
a photo of a black donut
|
200 |
+
a photo of a red vase
|
201 |
+
a photo of a purple pizza
|
202 |
+
a photo of a pink skateboard
|
203 |
+
a photo of a green skateboard
|
204 |
+
a photo of a purple bear
|
205 |
+
a photo of a brown chair
|
206 |
+
a photo of a brown computer keyboard
|
207 |
+
a photo of an orange cow
|
208 |
+
a photo of a brown skis
|
209 |
+
a photo of a white kite
|
210 |
+
a photo of a red dog
|
211 |
+
a photo of a green couch
|
212 |
+
a photo of a yellow airplane
|
213 |
+
a photo of an orange tv
|
214 |
+
a photo of a white scissors
|
215 |
+
a photo of a pink cell phone
|
216 |
+
a photo of a green surfboard
|
217 |
+
a photo of a white fire hydrant
|
218 |
+
a photo of a black bicycle
|
219 |
+
a photo of a purple carrot
|
220 |
+
a photo of a black dining table
|
221 |
+
a photo of a purple potted plant
|
222 |
+
a photo of a purple backpack
|
223 |
+
a photo of a yellow train
|
224 |
+
a photo of a pink potted plant
|
225 |
+
a photo of a red giraffe
|
226 |
+
a photo of a brown bear
|
227 |
+
a photo of a black train
|
228 |
+
a photo of an orange laptop
|
229 |
+
a photo of a green hot dog
|
230 |
+
a photo of a yellow parking meter
|
231 |
+
a photo of a red potted plant
|
232 |
+
a photo of a green traffic light
|
233 |
+
a photo of a blue tv
|
234 |
+
a photo of a brown refrigerator
|
235 |
+
a photo of a black tv remote
|
236 |
+
a photo of a purple scissors
|
237 |
+
a photo of a yellow orange
|
238 |
+
a photo of a brown toaster
|
239 |
+
a photo of a red parking meter
|
240 |
+
a photo of a brown orange
|
241 |
+
a photo of a green clock
|
242 |
+
a photo of a white sheep
|
243 |
+
a photo of a yellow oven
|
244 |
+
a photo of a green vase
|
245 |
+
a photo of a black teddy bear
|
246 |
+
a photo of a yellow carrot
|
247 |
+
a photo of a black hot dog
|
248 |
+
a photo of a red scissors
|
249 |
+
a photo of a white teddy bear
|
250 |
+
a photo of a black skis
|
251 |
+
a photo of a blue dining table
|
252 |
+
a photo of a black refrigerator
|
253 |
+
a photo of a white dog
|
254 |
+
a photo of an orange scissors
|
255 |
+
a photo of a red cell phone
|
256 |
+
a photo of a white orange
|
257 |
+
a photo of a blue clock
|
258 |
+
a photo of a blue carrot
|
259 |
+
a photo of a green motorcycle
|
260 |
+
a photo of a pink stop sign
|
261 |
+
a photo of a black vase
|
262 |
+
a photo of a black backpack
|
263 |
+
a photo of a red car
|
264 |
+
a photo of a green computer mouse
|
265 |
+
a photo of a red backpack
|
266 |
+
a photo of a green bus
|
267 |
+
a photo of an orange toaster
|
268 |
+
a photo of a yellow fork
|
269 |
+
a photo of a pink parking meter
|
270 |
+
a photo of a blue book
|
271 |
+
a photo of a yellow broccoli
|
272 |
+
a photo of an orange computer mouse
|
273 |
+
a photo of a red cake
|
274 |
+
a photo of a dog right of a teddy bear
|
275 |
+
a photo of a wine glass above a kite
|
276 |
+
a photo of a couch below a cup
|
277 |
+
a photo of a laptop left of a cow
|
278 |
+
a photo of a fork above a hair drier
|
279 |
+
a photo of a tie right of a baseball bat
|
280 |
+
a photo of a stop sign above a fork
|
281 |
+
a photo of a bird below a skateboard
|
282 |
+
a photo of an apple above a tv
|
283 |
+
a photo of a train above a potted plant
|
284 |
+
a photo of a truck left of a refrigerator
|
285 |
+
a photo of a tv remote below a cow
|
286 |
+
a photo of a bottle right of a train
|
287 |
+
a photo of a dog above a cow
|
288 |
+
a photo of a skateboard above a person
|
289 |
+
a photo of a baseball glove below an umbrella
|
290 |
+
a photo of a dining table right of an oven
|
291 |
+
a photo of a hot dog left of a suitcase
|
292 |
+
a photo of a bus below a toothbrush
|
293 |
+
a photo of a backpack right of a sandwich
|
294 |
+
a photo of a cake below a baseball bat
|
295 |
+
a photo of a dog right of a tie
|
296 |
+
a photo of a suitcase right of a boat
|
297 |
+
a photo of a bear above a clock
|
298 |
+
a photo of a tv remote left of an umbrella
|
299 |
+
a photo of a sports ball left of an umbrella
|
300 |
+
a photo of a train right of a dining table
|
301 |
+
a photo of a hair drier below an elephant
|
302 |
+
a photo of a tennis racket right of a spoon
|
303 |
+
a photo of a wine glass right of a hot dog
|
304 |
+
a photo of a computer mouse left of a bench
|
305 |
+
a photo of a carrot left of an orange
|
306 |
+
a photo of a kite above a toothbrush
|
307 |
+
a photo of a toaster below a traffic light
|
308 |
+
a photo of a cat below a baseball glove
|
309 |
+
a photo of a skis right of a zebra
|
310 |
+
a photo of a stop sign above a chair
|
311 |
+
a photo of a stop sign above a parking meter
|
312 |
+
a photo of a hot dog right of a skateboard
|
313 |
+
a photo of a pizza below a computer keyboard
|
314 |
+
a photo of a hair drier left of a toilet
|
315 |
+
a photo of a cow left of a stop sign
|
316 |
+
a photo of a suitcase above a skis
|
317 |
+
a photo of a book above a laptop
|
318 |
+
a photo of a toothbrush below a pizza
|
319 |
+
a photo of a toilet left of a kite
|
320 |
+
a photo of a tie above a sink
|
321 |
+
a photo of a bird left of a couch
|
322 |
+
a photo of a bed right of a sports ball
|
323 |
+
a photo of an elephant below a surfboard
|
324 |
+
a photo of a frisbee right of a motorcycle
|
325 |
+
a photo of a vase above a fire hydrant
|
326 |
+
a photo of a zebra left of an elephant
|
327 |
+
a photo of a bench left of a bear
|
328 |
+
a photo of a donut right of a bench
|
329 |
+
a photo of a frisbee below a horse
|
330 |
+
a photo of a computer keyboard above a snowboard
|
331 |
+
a photo of a tv below a cow
|
332 |
+
a photo of an elephant below a horse
|
333 |
+
a photo of a suitcase left of a banana
|
334 |
+
a photo of a train below an airplane
|
335 |
+
a photo of a cat below a backpack
|
336 |
+
a photo of a backpack below a cake
|
337 |
+
a photo of a sandwich below a knife
|
338 |
+
a photo of a bicycle above a parking meter
|
339 |
+
a photo of a knife right of a suitcase
|
340 |
+
a photo of a hot dog above a knife
|
341 |
+
a photo of a zebra right of a parking meter
|
342 |
+
a photo of a chair left of a zebra
|
343 |
+
a photo of a cow below an airplane
|
344 |
+
a photo of a cup left of an umbrella
|
345 |
+
a photo of a zebra below a computer keyboard
|
346 |
+
a photo of a zebra below a broccoli
|
347 |
+
a photo of a laptop below a sports ball
|
348 |
+
a photo of a truck left of a baseball bat
|
349 |
+
a photo of a refrigerator above a baseball bat
|
350 |
+
a photo of a tv above a baseball bat
|
351 |
+
a photo of a baseball glove right of a bear
|
352 |
+
a photo of a refrigerator below a scissors
|
353 |
+
a photo of a dining table above a suitcase
|
354 |
+
a photo of a parking meter above a broccoli
|
355 |
+
a photo of a frisbee above a truck
|
356 |
+
a photo of a pizza right of a banana
|
357 |
+
a photo of a bus above a boat
|
358 |
+
a photo of a cell phone left of a tennis racket
|
359 |
+
a photo of a horse right of a broccoli
|
360 |
+
a photo of a broccoli above a bottle
|
361 |
+
a photo of a vase right of a horse
|
362 |
+
a photo of a bear above a spoon
|
363 |
+
a photo of a zebra right of a bed
|
364 |
+
a photo of a cow right of a laptop
|
365 |
+
a photo of a bed right of a frisbee
|
366 |
+
a photo of a tie right of a motorcycle
|
367 |
+
a photo of a laptop right of a tv
|
368 |
+
a photo of a cell phone right of a chair
|
369 |
+
a photo of a couch below a potted plant
|
370 |
+
a photo of a clock below a tv
|
371 |
+
a photo of a couch below a vase
|
372 |
+
a photo of a donut below a cat
|
373 |
+
a photo of a couch left of a toaster
|
374 |
+
a photo of a purple wine glass and a black apple
|
375 |
+
a photo of a green bus and a purple microwave
|
376 |
+
a photo of a green skis and a brown airplane
|
377 |
+
a photo of a yellow computer keyboard and a black sink
|
378 |
+
a photo of a pink oven and a green motorcycle
|
379 |
+
a photo of a purple parking meter and a red laptop
|
380 |
+
a photo of a yellow skateboard and an orange computer mouse
|
381 |
+
a photo of a red skis and a brown tie
|
382 |
+
a photo of a pink skateboard and a black train
|
383 |
+
a photo of a white handbag and a purple bed
|
384 |
+
a photo of a purple elephant and a brown sports ball
|
385 |
+
a photo of a purple dog and a black dining table
|
386 |
+
a photo of a white dining table and a red car
|
387 |
+
a photo of a blue cell phone and a green apple
|
388 |
+
a photo of a red car and an orange potted plant
|
389 |
+
a photo of a brown carrot and a white potted plant
|
390 |
+
a photo of a black kite and a green bear
|
391 |
+
a photo of a blue laptop and a brown bear
|
392 |
+
a photo of a green teddy bear and a brown kite
|
393 |
+
a photo of a yellow stop sign and a blue potted plant
|
394 |
+
a photo of an orange snowboard and a green cat
|
395 |
+
a photo of an orange truck and a pink sink
|
396 |
+
a photo of a brown hot dog and a purple pizza
|
397 |
+
a photo of a green couch and an orange umbrella
|
398 |
+
a photo of a brown bed and a pink cell phone
|
399 |
+
a photo of a black broccoli and a yellow cake
|
400 |
+
a photo of a red train and a purple bear
|
401 |
+
a photo of a purple tennis racket and a black sink
|
402 |
+
a photo of a blue vase and a black banana
|
403 |
+
a photo of a blue clock and a white cup
|
404 |
+
a photo of a red umbrella and a blue couch
|
405 |
+
a photo of a white handbag and a red giraffe
|
406 |
+
a photo of a pink tv remote and a blue airplane
|
407 |
+
a photo of a pink handbag and a black scissors
|
408 |
+
a photo of a brown car and a pink hair drier
|
409 |
+
a photo of a black bus and a brown cell phone
|
410 |
+
a photo of a purple sheep and a pink banana
|
411 |
+
a photo of a blue handbag and a white cell phone
|
412 |
+
a photo of a white pizza and a green umbrella
|
413 |
+
a photo of a white tie and a purple skateboard
|
414 |
+
a photo of a yellow sports ball and a green boat
|
415 |
+
a photo of a white wine glass and a brown giraffe
|
416 |
+
a photo of a yellow bowl and a white baseball glove
|
417 |
+
a photo of an orange microwave and a black spoon
|
418 |
+
a photo of an orange skateboard and a pink bowl
|
419 |
+
a photo of a blue toilet and a white suitcase
|
420 |
+
a photo of a white boat and an orange hot dog
|
421 |
+
a photo of a yellow dining table and a pink dog
|
422 |
+
a photo of a red cake and a purple chair
|
423 |
+
a photo of a blue tie and a pink dining table
|
424 |
+
a photo of a blue cow and a black computer keyboard
|
425 |
+
a photo of a yellow pizza and a green oven
|
426 |
+
a photo of a red laptop and a brown car
|
427 |
+
a photo of a purple computer keyboard and a blue scissors
|
428 |
+
a photo of a green surfboard and an orange oven
|
429 |
+
a photo of a yellow parking meter and a pink refrigerator
|
430 |
+
a photo of a brown computer mouse and a purple bottle
|
431 |
+
a photo of a red umbrella and a green cow
|
432 |
+
a photo of a red giraffe and a black cell phone
|
433 |
+
a photo of a brown oven and a purple train
|
434 |
+
a photo of a blue baseball bat and a pink book
|
435 |
+
a photo of a green cup and a yellow bowl
|
436 |
+
a photo of a yellow suitcase and a brown bus
|
437 |
+
a photo of an orange motorcycle and a pink donut
|
438 |
+
a photo of an orange giraffe and a white baseball glove
|
439 |
+
a photo of an orange handbag and a green carrot
|
440 |
+
a photo of a black bottle and a white refrigerator
|
441 |
+
a photo of a white dog and a blue potted plant
|
442 |
+
a photo of an orange handbag and a red car
|
443 |
+
a photo of a red stop sign and a blue book
|
444 |
+
a photo of a yellow car and an orange toothbrush
|
445 |
+
a photo of a black potted plant and a yellow toilet
|
446 |
+
a photo of a brown dining table and a white suitcase
|
447 |
+
a photo of an orange donut and a yellow stop sign
|
448 |
+
a photo of a green suitcase and a blue boat
|
449 |
+
a photo of an orange tennis racket and a yellow sports ball
|
450 |
+
a photo of a purple computer keyboard and a red chair
|
451 |
+
a photo of a purple suitcase and an orange pizza
|
452 |
+
a photo of a white bottle and a blue sheep
|
453 |
+
a photo of a purple backpack and a white umbrella
|
454 |
+
a photo of an orange potted plant and a black spoon
|
455 |
+
a photo of a green tennis racket and a black dog
|
456 |
+
a photo of a yellow handbag and a blue refrigerator
|
457 |
+
a photo of a pink broccoli and a red sink
|
458 |
+
a photo of a red bowl and a pink sink
|
459 |
+
a photo of a white toilet and a red apple
|
460 |
+
a photo of a pink dining table and a black sandwich
|
461 |
+
a photo of a black car and a green parking meter
|
462 |
+
a photo of a yellow bird and a black motorcycle
|
463 |
+
a photo of a brown giraffe and a white stop sign
|
464 |
+
a photo of a white banana and a black elephant
|
465 |
+
a photo of an orange cow and a purple sandwich
|
466 |
+
a photo of a red clock and a black cell phone
|
467 |
+
a photo of a brown knife and a blue donut
|
468 |
+
a photo of a red cup and a pink handbag
|
469 |
+
a photo of a yellow bicycle and a red motorcycle
|
470 |
+
a photo of a red orange and a purple broccoli
|
471 |
+
a photo of an orange traffic light and a white toilet
|
472 |
+
a photo of a green cup and a red pizza
|
473 |
+
a photo of a blue pizza and a yellow baseball glove
|
prompts/ocr.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
prompts/pickscore.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
requirements.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
accelerate
|
2 |
+
diffusers
|
3 |
+
invisible_watermark
|
4 |
+
torch
|
5 |
+
transformers
|
6 |
+
xformers
|
7 |
+
peft
|
8 |
+
sentencepiece
|