dbaranchuk commited on
Commit
75d29b6
·
1 Parent(s): d315a84

Update space

Browse files
Files changed (1) hide show
  1. app.py +17 -127
app.py CHANGED
@@ -99,142 +99,32 @@ with gr.Blocks(css=css) as demo:
99
  examples = [
100
  [
101
  "examples/orig_3.jpg", #input_image
102
- "a photo of a basket of apples", #src_prompt
103
- "a photo of a basket of oranges", #tgt_prompt
104
- 20, #guidance_scale
105
- 0.6, #tau
106
- 0.4, #crs
107
- 0.6, #srs
108
- 1, #amplify factor
109
- 'oranges', # amplify word
110
- '', #orig blend
111
- 'oranges', #edited blend
112
- False #replacement
113
- ],
114
- [
115
- "examples/orig_3.jpg", #input_image
116
- "a photo of a basket of apples", #src_prompt
117
- "a photo of a basket of puppies", #tgt_prompt
118
- 20, #guidance_scale
119
- 0.6, #tau
120
- 0.4, #crs
121
- 0.1, #srs
122
- 2, #amplify factor
123
- 'puppies', # amplify word
124
- '', #orig blend
125
- 'puppies', #edited blend
126
- True #replacement
127
- ],
128
- [
129
- "examples/orig_3.jpg", #input_image
130
- "a photo of a basket of apples", #src_prompt
131
- "a photo of a basket of apples under snowfall", #tgt_prompt
132
- 20, #guidance_scale
133
- 0.6, #tau
134
- 0.4, #crs
135
- 0.4, #srs
136
- 30, #amplify factor
137
- 'snowfall', # amplify word
138
- '', #orig blend
139
- 'snowfall', #edited blend
140
- False #replacement
141
- ],
142
- [
143
- "examples/orig_1.jpg", #input_image
144
- "a photo of an owl", #src_prompt
145
- "a photo of an yellow owl", #tgt_prompt
146
- 20, #guidance_scale
147
- 0.6, #tau
148
- 0.9, #crs
149
- 0.9, #srs
150
- 20, #amplify factor
151
- 'yellow', # amplify word
152
- 'owl', #orig blend
153
- 'yellow', #edited blend
154
- False #replacement
155
- ],
156
- [
157
- "examples/orig_1.jpg", #input_image
158
- "a photo of an owl", #src_prompt
159
- "an anime-style painting of an owl", #tgt_prompt
160
- 20, #guidance_scale
161
- 0.8, #tau
162
- 0.6, #crs
163
- 0.3, #srs
164
- 10, #amplify factor
165
- 'anime-style', # amplify word
166
- 'painting', #orig blend
167
- 'anime-style', #edited blend
168
- False #replacement
169
  ],
170
  [
171
  "examples/orig_1.jpg", #input_image
172
- "a photo of an owl", #src_prompt
173
- "a photo of an owl underwater with many fishes nearby", #tgt_prompt
174
- 20, #guidance_scale
175
- 0.8, #tau
176
- 0.4, #crs
177
- 0.4, #srs
178
- 18, #amplify factor
179
- 'fishes', # amplify word
180
- '', #orig blend
181
- 'fishes', #edited blend
182
- False #replacement
183
- ],
184
- [
185
- "examples/orig_2.jpg", #input_image
186
- "a photograph of a teddy bear sitting on a wall", #src_prompt
187
- "a photograph of a teddy bear sitting on a wall surrounded by roses", #tgt_prompt
188
- 20, #guidance_scale
189
- 0.6, #tau
190
- 0.4, #crs
191
- 0.1, #srs
192
- 25, #amplify factor
193
- 'roses', # amplify word
194
- '', #orig blend
195
- 'roses', #edited blend
196
- False #replacement
197
  ],
198
  [
199
  "examples/orig_2.jpg", #input_image
200
- "a photograph of a teddy bear sitting on a wall", #src_prompt
201
- "a photograph of a wooden bear sitting on a wall", #tgt_prompt
202
- 20, #guidance_scale
203
- 0.8, #tau
204
- 0.5, #crs
205
- 0.5, #srs
206
- 14, #amplify factor
207
- 'wooden', # amplify word
208
- '', #orig blend
209
- 'wooden', #edited blend
210
- True #replacement
211
- ],
212
- [
213
- "examples/orig_2.jpg", #input_image
214
- "a photograph of a teddy bear sitting on a wall", #src_prompt
215
- "a photograph of a teddy rabbit sitting on a wall", #tgt_prompt
216
- 20, #guidance_scale
217
- 0.8, #tau
218
- 0.4, #crs
219
- 0.4, #srs
220
- 3, #amplify factor
221
- 'rabbit', # amplify word
222
- '', #orig blend
223
- 'rabbit', #edited blend
224
- True #replacement
225
  ],
226
  ]
227
 
228
- #gr.Examples(
229
- # examples = examples,
230
- # inputs =[input_image, input_prompt, prompt,
231
- # guidance_scale, tau, crs, srs, amplify_factor, amplify_word,
232
- # blend_orig, blend_edited, is_replacement],
233
- # outputs=[
234
- # result
235
- # ],
236
- # fn=infer, cache_examples=True
237
- #)
238
 
239
  run_button.click(
240
  fn = infer,
 
99
  examples = [
100
  [
101
  "examples/orig_3.jpg", #input_image
102
+ "turn apples into oranges", #tgt_prompt
103
+ 2, #guidance_scale
104
+ 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  ],
106
  [
107
  "examples/orig_1.jpg", #input_image
108
+ "Make it a Modigliani painting", #tgt_prompt
109
+ 2, #guidance_scale
110
+ 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  ],
112
  [
113
  "examples/orig_2.jpg", #input_image
114
+ "Add sunglasses to teddy bear", #tgt_prompt
115
+ 2, #guidance_scale
116
+ 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  ],
118
  ]
119
 
120
+ gr.Examples(
121
+ examples = examples,
122
+ inputs =[image, edit_instruction, guidance_scale, n_steps]
123
+ outputs=[
124
+ result
125
+ ],
126
+ fn=infer, cache_examples=True
127
+ )
 
 
128
 
129
  run_button.click(
130
  fn = infer,