forked from Hillobar/Rope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDicts.py
375 lines (326 loc) · 18.2 KB
/
Dicts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
PARAM_BUTTONS_PARAMS = {
'UpscaleState': False,
'UpscaleMode': 0,
'UpscaleModes': ['GFPGAN', 'CF', 'GPEN256', 'GPEN512'],
'UpscaleAmount': [100, 100, 100, 100],
'UpscaleMin': 0,
'UpscaleMax': 100,
'UpscaleInc': 5,
'UpscaleUnit': '%',
'UpscaleIcon': './rope/media/gfpgan_logo.png',
'UpscaleMessage': 'UPSCALER - Upscales faces. [LB: on/off, RB: GFPGAN/Codeformer/GPEN256/GPEN512, MW: amount]',
'DiffState': False,
'DiffMode': 0,
'DiffModes': ['Diff'],
'DiffAmount': [4],
'DiffMin': 0,
'DiffMax': 100,
'DiffInc': 2,
'DiffUnit': '%',
'DiffIcon': './rope/media/diff.png',
'DiffMessage': 'DIFFERENCER - Blends between Target Face and Swapped Face based on pixel difference. [LB: on/off, MW: difference threshold]',
'BorderState': False,
'BorderMode': 0,
'BorderModes': ['Brdr Top', 'Brdr Sides', 'Brdr Bttm', 'Brdr Blur'],
'BorderAmount': [10, 10, 10, 10],
'BorderMin': 0,
'BorderMax': 64,
'BorderInc': 1,
'BorderUnit': '%',
'BorderIcon': './rope/media/maskup.png',
'BorderMessage': 'BORDER - A rectangle with adjustable top, bottom, and sides that blends the Swapped Face. [RB: top/sides/bottom/blur, MW: amount]',
'MaskViewState': False,
'MaskViewMode': 0,
'MaskViewModes': ['Show Masks'],
'MaskViewAmount': [5],
'MaskViewMin': 0,
'MaskViewMax': 50,
'MaskViewInc': 0,
'MaskViewUnit': '',
'MaskViewIcon': './rope/media/maskblur.png',
'MaskViewMessage': 'SHOW MASKS - Displays the mask for a face side-by-side with the face. Useful for understanding the masking behaviors and results. [LB: on/off]',
'CLIPState': False,
'CLIPMode': 0,
'CLIPModes': ['CLIP'],
'CLIPAmount': [50],
'CLIPMin': 0,
'CLIPMax': 100,
'CLIPInc': 1,
'CLIPUnit': '%',
'CLIPIcon': './rope/media/CLIP.png',
'CLIPMessage': 'CLIP - Text based occluder. Occluded objects are visible in the final image (occluded from the mask). [LB: on/off, MW: strength]',
'OccluderState': False,
'OccluderMode': 0,
'OccluderModes': ['Occluder'],
'OccluderAmount': [0],
'OccluderMin': -100,
'OccluderMax': 100,
'OccluderInc': 1,
'OccluderUnit': '%',
'OccluderIcon': './rope/media/occluder.png',
'OccluderMessage': 'OCCLUDER - Automatic occluder. Any object in the face region is occluded. [LB: on/off, MW: additional size]',
'FaceParserState': False,
'FaceParserMode': 0,
'FaceParserModes': ['Mouth', 'Background'],
'FaceParserAmount': [0, 0],
'FaceParserMin': -50,
'FaceParserMax': 50,
'FaceParserInc': 1,
'FaceParserUnit': '%',
'FaceParserIcon': './rope/media/parse.png',
'FaceParserMessage': 'PARSER - Performs occlusion based on features. [LB: on/off, RB: mouth/everything but the face, MW: amount (0 is off, <0 is inside of mouth only for mouth mode)]',
'BlurState': False,
'BlurMode': 0,
'BlurModes': ['Blur'],
'BlurAmount': [5],
'BlurMin': 0,
'BlurMax': 100,
'BlurInc': 1,
'BlurUnit': '%',
'BlurIcon': './rope/media/blur.png',
'BlurMessage': 'BLUR - Global blur. Blurs the combined masks to soften the edges. Is not applied to the inital mask. [MW: amount]',
'ThresholdState': False,
'ThresholdMode': 0,
'ThresholdModes': ['Threshold'],
'ThresholdAmount': [85],
'ThresholdMin': 0,
'ThresholdMax': 100,
'ThresholdInc': 1,
'ThresholdUnit': '%',
'ThresholdIcon': './rope/media/thresh.png',
'ThresholdMessage': 'THRESHOLD - Threshold for determining if Target Faces match faces in a frame. Lower is stricter. [LB: use amount/match all, MW: value]',
'StrengthState': False,
'StrengthMode': 0,
'StrengthModes': ['Strength'],
'StrengthAmount': [100],
'StrengthMin': 25,
'StrengthMax': 500,
'StrengthInc': 25,
'StrengthUnit': '%',
'StrengthIcon': './rope/media/strength.png',
'StrengthMessage': 'STRENGTH - Strength of the Swapper model. This performs additional iterations per 100% (100%=1, 200%=2, ... [MW: amount]',
'OrientationState': False,
'OrientationMode': 0,
'OrientationModes': ['Orient'],
'OrientationAmount': [0],
'OrientationMin': 0,
'OrientationMax': 270,
'OrientationInc': 90,
'OrientationUnit': '%',
'OrientationIcon': './rope/media/orient.png',
'OrientationMessage': 'ORIENTATION - Rotate the face detector to better detect faces at different angles. [MW: angle]',
'RefDelState': False,
'RefDelMode': 0,
'RefDelModes': ['del_x', 'del_y', 'scale'],
'RefDelAmount': [0, 0, 0],
'RefDelMin': -100,
'RefDelMax': 100,
'RefDelInc': 1,
'RefDelUnit': '%',
'RefDelIcon': './rope/media/construction.png',
'RefDelMessage': 'REFERENCE DELTA - Modify the reference points. Turn on mask preview to see adjustments. [LB: on/off, RB: translate x/y, and scale, MW: amount]',
'TransformState': False,
'TransformMode': 0,
'TransformModes': ['Scale'],
'TransformAmount': [0],
'TransformMin': -20,
'TransformMax': 20,
'TransformInc': 1,
'TransformUnit': '%',
'TransformIcon': './rope/media/scale.png',
'TransformMessage': 'SCALE - Adjust the scale of the face. Use with Background parser to blend into the image. [LB: on/off, MW: amount]',
'ColorState': False,
'ColorMode': 0,
'ColorModes': ['Red', 'Green', 'Blue'],
'ColorAmount': [0, 0, 0],
'ColorMin': -100,
'ColorMax': 100,
'ColorInc': 1,
'ColorUnit': 'i',
'ColorIcon': './rope/media/rgb.png',
'ColorMessage': 'RGB ADJUSTMENT - Fine-tune the RGB color values of the swap. [LB: on/off, RB: Red/Green/Blue, MW: amount]',
"CLIPText": '',
# 'ImgVid': 'Video',
}
PARAM_BUTTONS_CONSTANT = {
}
ACTIONS = {
'DockState': False,
'DockMode': 0,
'DockModes': [''],
'DockIcon': './rope/media/dock.png',
'DockMessage': 'DOCK/UNDOCK WINDOW - Undocks and docks the preview wimdow area.',
'DockButton': [],
'DockIconHolder': [],
'ImgDockState': False,
'ImgDockMode': 0,
'ImgDockModes': [''],
'ImgDockIcon': './rope/media/dock.png',
'ImgDockMessage': 'DOCK/UNDOCK WINDOW - Undocks and docks the preview wimdow area.',
'ImgDockButton': [],
'ImgDockIconHolder': [],
'SaveImageState': False,
'SaveImageMode': 0,
'SaveImageModes': [''],
'SaveImageIcon': './rope/media/save_disk.png',
'SaveImageMessage': 'SAVE IMAGE - Save image to output folder',
'SaveImageButton': [],
'SaveImageIconHolder': [],
'AutoSwapState': False,
'AutoSwapMode': 0,
'AutoSwapModes': ['Auto'],
'AutoSwapIcon': './rope/media/construction.png',
'AutoSwapMessage': 'AUTO SWAP - Automatically swaps the first person in an image to the selcted source faces [LB: Turn on/off]',
'AutoSwapButton': [],
'AutoSwapIconHolder': [],
'PlayState': False,
'PlayMode': 0,
'PlayModes': [''],
'PlayIcon': './rope/media/play.png',
'PlayMessage': 'PLAY - Plays the video. Press again to stop playing',
'PlayButton': [],
'PlayIconHolder': [],
'RecordState': False,
'RecordMode': 0,
'RecordModes': [''],
'RecordIcon': './rope/media/rec.png',
'RecordMessage': 'RECORD - Arms the PLAY button for recording. Press RECORD, then PLAY to record. Press PLAY again to stop recording.',
'RecordButton': [],
'RecordIconHolder': [],
'AddMarkerState': False,
'AddMarkerMode': 0,
'AddMarkerModes': [''],
'AddMarkerIcon': './rope/media/add.png',
'AddMarkerMessage': 'ADD MARKER - Attaaches a parameter marker to the current frame. Markers copy all parameter settings and apply them to all future frames, or until another marker is encountered.',
'AddMarkerButton': [],
'AddMarkerIconHolder': [],
'RemoveMarkerState': False,
'RemoveMarkerMode': 0,
'RemoveMarkerModes': [''],
'RemoveMarkerIcon': './rope/media/remove.png',
'RemoveMarkerMessage': 'REMOVE MARKER - Removes the parameter marker from the current frame.',
'RemoveMarkerButton': [],
'RemoveMarkerIconHolder': [],
'PrevMarkerState': False,
'PrevMarkerMode': 0,
'PrevMarkerModes': [''],
'PrevMarkerIcon': './rope/media/prev.png',
'PrevMarkerMessage': 'PREVIOUS MARKER - Move to the previous marker.',
'PrevMarkerButton': [],
'PrevMarkerIconHolder': [],
'NextMarkerState': False,
'NextMarkerMode': 0,
'NextMarkerModes': [''],
'NextMarkerIcon': './rope/media/next.png',
'NextMarkerMessage': 'NEXT MARKER - Move to the next marker.',
'NextMarkerButton': [],
'NextMarkerIconHolder': [],
'ToggleStopState': False,
'ToggleStopMode': 0,
'ToggleStopModes': [''],
'ToggleStopIcon': './rope/media/STOP.png',
'ToggleStopMessage': 'STOP MARKER - Sets a frame that will stop the video playing/recording.',
'ToggleStopButton': [],
'ToggleStopIconHolder': [],
'FindFacesState': False,
'FindFacesMode': 0,
'FindFacesModes': ['Find'],
'FindFacesIcon': './rope/media/tarface.png',
'FindFacesMessage': 'FIND FACES - Find all faces in the current frame.',
'ClearFacesState': False,
'ClearFacesMode': 0,
'ClearFacesModes': ['Clear'],
'ClearFacesIcon': './rope/media/tarfacedel.png',
'ClearFacesMessage': 'REMOVE FACES - Remove all currently found faces.',
'SwapFacesState': False,
'SwapFacesMode': 0,
'SwapFacesModes': ['Swap'],
'SwapFacesIcon': './rope/media/swap.png',
'SwapFacesMessage': 'SWAP - Swap assigned Source Faces and Target Faces',
'SwapFacesButton': [],
'SwapFacesIconHolder': [],
'LoadSFacesState': False,
'LoadSFacesMode': 0,
'LoadSFacesModes': [''],
'LoadSFacesIcon': './rope/media/save.png',
'LoadSFacesMessage': 'LOAD SOURCE FACES - Load Source Faces from Folder. Make sure the folder only contains <good> images.',
'LoadSFacesButton': [],
'LoadSFacesIconHolder': [],
'DelEmbedState': False,
'DelEmbedMode': 0,
'DelEmbedModes': ['Del Emb'],
'DelEmbedIcon': './rope/media/delemb.png',
'DelEmbedMessage': 'DELETE EMBEDDING - Delete the currently selected embedding',
'DelEmbedButton': [],
'DelEmbedIconHolder': [],
'LoadTVideosState': False,
'LoadTVideosMode': 0,
'LoadTVideosModes': [''],
'LoadTVideosIcon': './rope/media/save.png',
'LoadTVideosMessage': 'LOAD TARGET VIDEOS/IMAGES - Load targets from folder.',
'LoadTVideosButton': [],
'LoadTVideosIconHolder': [],
'ImgVidState': False,
'ImgVidMode': 0,
'ImgVidModes': ['Videos', 'Images'],
'ImgVidIcon': './rope/media/imgvid.png',
'ImgVidMessage': 'IMAGE/VIDEO - Toggle between Image and Video folder view.',
'ImgVidButton': [],
'ImgVidIconHolder': [],
'HoldFaceState': False,
'HoldFaceMode': 0,
'HoldFaceModes': ['HoldFace'],
'HoldFaceIcon': './rope/media/imgvid.png',
'HoldFaceMessage': 'IMAGE/VIDEO - Toggle between Image and Video folder view.',
'HoldFaceButton': [],
'HoldFaceIconHolder': [],
'StartRopeState': False,
'StartRopeMode': 0,
'StartRopeModes': ['Start Rope'],
'StartRopeIcon': './rope/media/save.png',
'StartRopeMessage': 'START ROPE - Loads all folders and initializes models',
'StartRopeButton': [],
'StartRopeIconHolder': [],
'OutputFolderState': False,
'OutputFolderMode': 0,
'OutputFolderModes': [''],
'OutputFolderIcon': './rope/media/save.png',
'OutputFolderMessage': 'OUTPUT FOLDER - Select folder for Image and Video output.',
'OutputFolderButton': [],
'OutputFolderIconHolder': [],
'ThreadsState': False,
'ThreadsMode': 0,
'ThreadsModes': [''],
'ThreadsIcon': './rope/media/threads.png',
'ThreadsMessage': 'THREADS - Set number of execution threads. [MW: set number of threads]',
'ThreadsButton': [],
'ThreadsIconHolder': [],
'VideoQualityState': False,
'VideoQualityMode': 0,
'VideoQualityModes': [''],
'VideoQualityIcon': './rope/media/tarface.png',
'VideoQualityMessage': 'VIDEO QUALITY - The encoding quality of the recorded video. 0 is best, 50 is wrost, 18 is mostly lossless. File size increases with a lower quality number.',
'VideoQualityButton': [],
'VideoQualityIconHolder': [],
'PerfTestState': False,
'PerfTestMode': 0,
'PerfTestModes': ['Perf Test'],
'PerfTestIcon': './rope/media/test.png',
'PerfTestMessage': 'PERFORMANCE DATA - Displays timing data in the console for critical Rope functions. [LB: on/off]',
'PerfTestButton': [],
'PerfTestIconHolder': [],
'ClearmemState': False,
'ClearmemMode': 0,
'ClearmemModes': ['Clear'],
'ClearmemIcon': './rope/media/clear_mem.png',
'ClearmemMessage': 'CLEAR VRAM - Clears all models from VRAM [LB: Clear]',
'ClearmemButton': [],
'ClearmemIconHolder': [],
# 'State': False,
# 'Mode': 0,
# 'Modes': ['Videos', 'Images'],
# 'Icon': './rope/media/imgvid.png',
# 'Message': 'IMAGE/VIDEO - Toggle between Image and Video folder view.',
# 'Button': [],
# 'IconHolder': [],
}