Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
fix: Compatible with the old version
Browse files Browse the repository at this point in the history
Signed-off-by: AnyISalIn <[email protected]>
  • Loading branch information
AnyISalIn committed Jul 20, 2023
1 parent 452a869 commit 19954f6
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from modules import images, script_callbacks, errors, processing, ui, shared
from modules.processing import Processed, StableDiffusionProcessingImg2Img, StableDiffusionProcessingTxt2Img, StableDiffusionProcessing
from modules.shared import opts, state, prompt_styles
from modules.ui_common import ToolButton, refresh_symbol
from extension import api

from inspect import getmembers, isfunction
Expand All @@ -19,6 +18,25 @@
DEMO_MODE = os.getenv("CLOUD_INFERENCE_DEMO_MODE")


refresh_symbol = '\U0001f504' # 🔄


class FormComponent:
def get_expected_parent(self):
return gr.components.Form


class ToolButton(FormComponent, gr.Button):
"""Small button with single emoji as text, fits inside gradio forms"""

def __init__(self, *args, **kwargs):
classes = kwargs.pop("elem_classes", [])
super().__init__(*args, elem_classes=["tool", *classes], **kwargs)

def get_block_name(self):
return "button"


class _Proxy(object):

def __init__(self, fn):
Expand Down

0 comments on commit 19954f6

Please sign in to comment.