mirror of
https://github.com/s0md3v/roop.git
synced 2025-12-06 18:08:29 +00:00
Adjust project structure
This commit is contained in:
parent
3dd9a359b1
commit
7cacbddb1f
0
roop/uis/__components__/__init__.py
Normal file
0
roop/uis/__components__/__init__.py
Normal file
@ -5,8 +5,6 @@ import roop.globals
|
||||
from roop.core import start
|
||||
from roop.utilities import has_image_extension, has_video_extension, normalize_output_path
|
||||
|
||||
NAME = 'ROOP.UIS.OUTPUT'
|
||||
|
||||
|
||||
def render() -> None:
|
||||
with gradio.Column():
|
||||
@ -20,7 +18,7 @@ def render() -> None:
|
||||
|
||||
|
||||
def update() -> Tuple[Dict[str, Any], Dict[str, Any]]:
|
||||
roop.globals.output_path = normalize_output_path(roop.globals.source_path, roop.globals.target_path, '.')
|
||||
roop.globals.output_path = normalize_output_path(roop.globals.source_path, roop.globals.target_path, '..')
|
||||
if roop.globals.output_path:
|
||||
start()
|
||||
if has_image_extension(roop.globals.output_path):
|
||||
@ -14,8 +14,6 @@ from roop.typing import Frame
|
||||
from roop.uis import core as ui
|
||||
from roop.utilities import is_video, is_image
|
||||
|
||||
NAME = 'ROOP.UIS.PREVIEW'
|
||||
|
||||
|
||||
def render() -> None:
|
||||
with gradio.Box():
|
||||
@ -6,8 +6,6 @@ import roop.globals
|
||||
from roop.processors.frame.core import list_frame_processors_names, clear_frame_processors_modules
|
||||
from roop.uis import core as ui
|
||||
|
||||
NAME = 'ROOP.UIS.OUTPUT'
|
||||
|
||||
|
||||
def render() -> None:
|
||||
with gradio.Column():
|
||||
@ -6,8 +6,6 @@ from roop.face_reference import clear_face_reference
|
||||
from roop.uis import core as ui
|
||||
from roop.utilities import is_image
|
||||
|
||||
NAME = 'ROOP.UIS.SOURCE'
|
||||
|
||||
|
||||
def render() -> None:
|
||||
with gradio.Box():
|
||||
@ -6,8 +6,6 @@ from roop.face_reference import clear_face_reference
|
||||
from roop.uis import core as ui
|
||||
from roop.utilities import is_image, is_video
|
||||
|
||||
NAME = 'ROOP.UIS.TARGET'
|
||||
|
||||
|
||||
def render() -> None:
|
||||
with gradio.Box():
|
||||
19
roop/uis/__layouts__/default.py
Normal file
19
roop/uis/__layouts__/default.py
Normal file
@ -0,0 +1,19 @@
|
||||
import gradio
|
||||
|
||||
from roop.uis.__components__ import settings, source, target, preview, output
|
||||
import roop.uis.core as ui
|
||||
|
||||
|
||||
def render() -> gradio.Blocks:
|
||||
with gradio.Blocks(theme=ui.get_theme()) as layout:
|
||||
with gradio.Row():
|
||||
with gradio.Column(scale=1):
|
||||
settings.render()
|
||||
with gradio.Column(scale=1):
|
||||
source.render()
|
||||
target.render()
|
||||
with gradio.Column(scale=2):
|
||||
preview.render()
|
||||
with gradio.Row():
|
||||
output.render()
|
||||
return layout
|
||||
@ -1,25 +1,14 @@
|
||||
from typing import Dict
|
||||
import gradio
|
||||
|
||||
from roop.uis import source, target, preview, settings, output
|
||||
from roop.uis.__layouts__ import default
|
||||
from roop.uis.typing import Component, ComponentName
|
||||
|
||||
COMPONENTS: Dict[ComponentName, Component] = {}
|
||||
|
||||
|
||||
def init() -> None:
|
||||
with gradio.Blocks(theme=get_theme()) as ui:
|
||||
with gradio.Row():
|
||||
with gradio.Column(scale=1):
|
||||
settings.render()
|
||||
with gradio.Column(scale=1):
|
||||
source.render()
|
||||
target.render()
|
||||
with gradio.Column(scale=2):
|
||||
preview.render()
|
||||
with gradio.Row():
|
||||
output.render()
|
||||
ui.launch()
|
||||
default.render().launch()
|
||||
|
||||
|
||||
def get_theme() -> gradio.Theme:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user