Replies: 6 comments 2 replies
-
Hello, It looks like you've managed to integrate custom options into a ReActor script for controlling codeformer_weight and restorer_visibility through the X/Y/Z interface in a creative way, despite not being a Python developer. Understanding codeformer_weight and restorer_visibility Restorer Visibility: This parameter seems to control the visibility restoration aspect of the process, possibly related to making obscured or partially visible faces more clear or restoring them in some way. The exact mechanism depends on how the restoration is implemented, but generally, it could mean enhancing features of faces that are not fully visible or are degraded in some way. Behavior Observation Suggestions for Improvement Avoiding Cache Issues: If you're encountering cache issues where old values persist, ensure that the values in shared.opts.data are reset or updated appropriately at the start or end of each operation. This could be handled within the lifecycle hooks of your scripts (e.g., on_app_started, on_before_ui, etc.) to ensure a clean state. Code Structure and Practices: Given your innovative solution, consider refining your code structure and practices by: Using more direct methods for parameter passing and state management. |
Beta Was this translation helpful? Give feedback.
-
Thx, but as i understand the code , codeformer_weight is a parameter for codeformer , and restore_visibility a parameter for GFPGAN as defined in : so i think that its a Beta, and restore_visibility && codeformer_weight will merge in a single value someday ( Mr Gourieff, can you confirm or i missed something ? ) For the dict.pop , if i look at hypertile method or controlnet method to implement x/y/z finally, the only weak point of my tricks is : what if another "extension" whant to use the same shared.opts of ReActor after i poped it out ? This extension is really great! |
Beta Was this translation helpful? Give feedback.
-
Hello! |
Beta Was this translation helpful? Give feedback.
-
ok so after searching how i can get the state of the x/y/z script running or not, i only found that there is a shared.state.job_count that is >0 if script xyz is running so here is the modification in reactor_faceswap.py :
and
So now, all seems fine Then , using it, i focused in restore_face() to understand why if 0 in restore_visibility do not get the original image (mean the generated by SD)
prompt : a portrait of an ugly woman |
Beta Was this translation helpful? Give feedback.
-
Done! With some modifications |
Beta Was this translation helpful? Give feedback.
-
Great ! Thank you ! Just to let me understand : why did you let the blend with the |
Beta Was this translation helpful? Give feedback.
-
Hello,
I tryed to implement the X/Y/Z script for ReActor and see how codeformer_weight and Restore_visibility works.
I succeed by some "tricks" (im not python dev) but i can't figure out the difference between 'codeformer_weight' and 'face visibility restorer'
and it seems that "face visibility"=0 && 'codeformer_weight'=0 => swap done . I was expecting 'no swap' at all
I need to improve my code but here how i done it, inspired from the 'hypertile_xyz.py'
first , it seems that the options in x/y/z must be a key in shared.opts.data Dict
1- i create a reactor_xyz.py
then i import it in the reactor_api.py
At this step, the 2 [reactor] must appear in the x/y/z list , but not binded
then, im too noob to understand how the xyz_grid pass the values to the reActor , so... i used a bad practice...
in reactor_faceswapp.php , in the 'process' , i pop the key from shared.opts.data ...
Note: i encountered some cache issues, its the reason of the dict.pop , to remove the key . Otherwise, if you stop using the x/y/z script it continue to use the values in shared.opts.data cache.
worked for me.
Hope it can help.
Beta Was this translation helpful? Give feedback.
All reactions