soten355 / MetalDiffusion

Stable Diffusion for Intel and Silicon Mac's. Forked from @divamgupta's work
Other
67 stars 5 forks source link

'Button' object has no attribute 'style' #10

Closed Eufalesio closed 7 months ago

Eufalesio commented 7 months ago

MacOS Ventura 13.5 Apple Silicon (M2), fresh installed MetalDiffusion

Starting program:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /Users/g/Documents/MetalDiffusion/dream.py:1114 in │ │ │ │ 1111 GUI │ │ 1112 """ │ │ 1113 │ │ ❱ 1114 gradioGUI = gradioGUIHandler( │ │ 1115 │ dreamer = dreamer, │ │ 1116 │ currentWeights = currentWeights, │ │ 1117 │ embeddingNames = embeddingNames, │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ allWeights = { │ │ │ │ │ 'diffusers': [], │ │ │ │ │ 'tensorflow': [], │ │ │ │ │ 'safetensors': [], │ │ │ │ │ 'ckpt': [], │ │ │ │ │ 'huggingFace': ['runwayml/stable-diffusion-v1-5'] │ │ │ │ } │ │ │ │ argparse = <module 'argparse' from │ │ │ │ '/Users/g/miniconda3/lib/python3.11/argparse.… │ │ │ │ box = <module 'rich.box' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/venv/lib/p… │ │ │ │ checkTime = <function checkTime at 0x308383740> │ │ │ │ CLIOverride = Namespace(share=False, inBrowser=False) │ │ │ │ color = <class 'utilities.consoleUtilities.color'> │ │ │ │ controlNetUtilities = <module 'utilities.controlNetUtilities' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/utilities/… │ │ │ │ controlNetWeights = ['Reference Only'] │ │ │ │ createLayout = <function createLayout at 0x308383600> │ │ │ │ currentWeights = ['runwayml/stable-diffusion-v1-5'] │ │ │ │ cv2 = <module 'cv2' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/venv/lib/p… │ │ │ │ deviceChoices = [ │ │ │ │ │ { │ │ │ │ │ │ 'name': 'Apple M2 Max', │ │ │ │ │ │ 'vendor': 'Apple (0x106b)', │ │ │ │ │ │ 'metalSupport': 'Metal 3', │ │ │ │ │ │ 'TensorFlow': PhysicalDevice( │ │ │ │ │ │ │ name='/physical_device:GPU:0', │ │ │ │ │ │ │ device_type='GPU' │ │ │ │ │ │ ) │ │ │ │ │ } │ │ │ │ ] │ │ │ │ dreamer = <main.dreamWorld object at 0x3083bfd90> │ │ │ │ dreamWorld = <class 'main.dreamWorld'> │ │ │ │ embeddingNames = [] │ │ │ │ embeddingWeights = ['models/embeddings/'] │ │ │ │ endProgramVariable = False │ │ │ │ gc = <module 'gc' (built-in)> │ │ │ │ generateDepthMap = <function run at 0x3083820c0> │ │ │ │ gr = <module 'gradio' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/venv/lib/p… │ │ │ │ gradioGUIHandler = <class 'GUI.gradioGUI.gradioGUIHandler'> │ │ │ │ Image = <module 'PIL.Image' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/venv/lib/p… │ │ │ │ imageTransformer = <module 'utilities.ImageTransformer' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/utilities/… │ │ │ │ install = <function install at 0x105b8eac0> │ │ │ │ LoRAs = [] │ │ │ │ model = None │ │ │ │ modelWrangler = <module 'utilities.modelWrangler' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/utilities/… │ │ │ │ np = <module 'numpy' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/venv/lib/p… │ │ │ │ os = <module 'os' (frozen)> │ │ │ │ Panel = <class 'rich.panel.Panel'> │ │ │ │ parser = ArgumentParser(prog='dream.py', usage=None, description=None, │ │ │ │ formatter_class=<class 'argparse.HelpFormatter'>, │ │ │ │ conflict_handler='error', add_help=True) │ │ │ │ PngInfo = <class 'PIL.PngImagePlugin.PngInfo'> │ │ │ │ print = <function print at 0x10584fa60> │ │ │ │ random = <module 'random' from │ │ │ │ '/Users/g/miniconda3/lib/python3.11/random.py… │ │ │ │ readWriteFile = <module 'utilities.readWriteFile' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/utilities/… │ │ │ │ setTiles = <function setTiles at 0x30b473740> │ │ │ │ settingsControl = <module 'utilities.settingsControl' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/utilities/… │ │ │ │ StableDiffusion = <class │ │ │ │ 'stableDiffusionTensorFlow.stableDiffusion.StableDiffusion'> │ │ │ │ StableDiffusionDiffusers = <class │ │ │ │ 'stableDiffusionDiffusers.stableDiffusion.StableDiffusionDiffuse… │ │ │ │ starterPrompt = { │ │ │ │ │ 'Model Prompts': ['mdjrny-v4 style'], │ │ │ │ │ 'Artists': [ │ │ │ │ │ │ 'Michaelangelo', │ │ │ │ │ │ 'Rembrandt', │ │ │ │ │ │ 'Caravaggio', │ │ │ │ │ │ 'Leonardo DaVinci', │ │ │ │ │ │ 'Andrew Wyeth', │ │ │ │ │ │ 'Ed Hopper', │ │ │ │ │ │ 'Alphonse Mucha' │ │ │ │ │ ], │ │ │ │ │ 'Keyword': [ │ │ │ │ │ │ 'highly detailed', │ │ │ │ │ │ 'textured', │ │ │ │ │ │ 'masterpiece', │ │ │ │ │ │ 'oil painting', │ │ │ │ │ │ 'water color', │ │ │ │ │ │ 'impressionism', │ │ │ │ │ │ 'romanticism', │ │ │ │ │ │ 'classical', │ │ │ │ │ │ 'realistic' │ │ │ │ │ ], │ │ │ │ │ 'Lighting': [ │ │ │ │ │ │ 'cinematic lighting', │ │ │ │ │ │ 'volumetric lighting', │ │ │ │ │ │ 'sunset', │ │ │ │ │ │ 'golden hour', │ │ │ │ │ │ 'blue hour', │ │ │ │ │ │ 'night time', │ │ │ │ │ │ 'noir lighting' │ │ │ │ │ ], │ │ │ │ │ 'Favorites': [ │ │ │ │ │ │ 'beautiful photo of an American Staffordshire Terrier in │ │ │ │ a nice house, shot on Ko'+62, │ │ │ │ │ │ 'mdjrny-v4 style, Cookie Monster as a king, portrait, │ │ │ │ renaissance style, Rembrand'+61 │ │ │ │ │ ] │ │ │ │ } │ │ │ │ tensorFlowUtilities = <module 'utilities.tensorFlowUtilities' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/utilities/… │ │ │ │ Text = <class 'rich.text.Text'> │ │ │ │ tf = <module 'tensorflow' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/venv/lib/p… │ │ │ │ time = <module 'time' (built-in)> │ │ │ │ torch = <module 'torch' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/venv/lib/p… │ │ │ │ userSettings = │ │ │ │ VAEWeights = ['Original'] │ │ │ │ videoUtil = <module 'utilities.videoUtilities' from │ │ │ │ '/Users/g/Documents/MetalDiffusion/utilities/… │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /Users/g/Documents/MetalDiffusion/GUI/gradioGUI.py:66 in init │ │ │ │ 63 │ │ │ so they can be accessed regardless of child/parent position in the layout │ │ 64 │ │ """ │ │ 65 │ │ │ │ ❱ 66 │ │ self.render = Render( │ │ 67 │ │ │ dreamer = dreamer │ │ 68 │ │ ) │ │ 69 │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ controlNetWeights = ['Reference Only'] │ │ │ │ currentWeights = ['runwayml/stable-diffusion-v1-5'] │ │ │ │ deviceChoices = [ │ │ │ │ │ { │ │ │ │ │ │ 'name': 'Apple M2 Max', │ │ │ │ │ │ 'vendor': 'Apple (0x106b)', │ │ │ │ │ │ 'metalSupport': 'Metal 3', │ │ │ │ │ │ 'TensorFlow': PhysicalDevice( │ │ │ │ │ │ │ name='/physical_device:GPU:0', │ │ │ │ │ │ │ device_type='GPU' │ │ │ │ │ │ ) │ │ │ │ │ } │ │ │ │ ] │ │ │ │ dreamer = <main.dreamWorld object at 0x3083bfd90> │ │ │ │ embeddingNames = [] │ │ │ │ LoRAs = [] │ │ │ │ self = <GUI.gradioGUI.gradioGUIHandler object at 0x3083bd250> │ │ │ │ starterPrompt = { │ │ │ │ │ 'Model Prompts': ['mdjrny-v4 style'], │ │ │ │ │ 'Artists': [ │ │ │ │ │ │ 'Michaelangelo', │ │ │ │ │ │ 'Rembrandt', │ │ │ │ │ │ 'Caravaggio', │ │ │ │ │ │ 'Leonardo DaVinci', │ │ │ │ │ │ 'Andrew Wyeth', │ │ │ │ │ │ 'Ed Hopper', │ │ │ │ │ │ 'Alphonse Mucha' │ │ │ │ │ ], │ │ │ │ │ 'Keyword': [ │ │ │ │ │ │ 'highly detailed', │ │ │ │ │ │ 'textured', │ │ │ │ │ │ 'masterpiece', │ │ │ │ │ │ 'oil painting', │ │ │ │ │ │ 'water color', │ │ │ │ │ │ 'impressionism', │ │ │ │ │ │ 'romanticism', │ │ │ │ │ │ 'classical', │ │ │ │ │ │ 'realistic' │ │ │ │ │ ], │ │ │ │ │ 'Lighting': [ │ │ │ │ │ │ 'cinematic lighting', │ │ │ │ │ │ 'volumetric lighting', │ │ │ │ │ │ 'sunset', │ │ │ │ │ │ 'golden hour', │ │ │ │ │ │ 'blue hour', │ │ │ │ │ │ 'night time', │ │ │ │ │ │ 'noir lighting' │ │ │ │ │ ], │ │ │ │ │ 'Favorites': [ │ │ │ │ │ │ 'beautiful photo of an American Staffordshire Terrier in a nice │ │ │ │ house, shot on Ko'+62, │ │ │ │ │ │ 'mdjrny-v4 style, Cookie Monster as a king, portrait, │ │ │ │ renaissance style, Rembrand'+61 │ │ │ │ │ ] │ │ │ │ } │ │ │ │ VAEWeights = ['Original'] │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /Users/g*****/Documents/MetalDiffusion/GUI/gradioGUI.py:352 in init │ │ │ │ 349 │ │ # Start Button │ │ 350 │ │ self.startButton = gr.Button("Start") │ │ 351 │ │ │ │ ❱ 352 │ │ self.startButton.style( │ │ 353 │ │ │ full_width = True │ │ 354 │ │ ) │ │ 355 │ │ │ │ ╭──────────────────────── locals ────────────────────────╮ │ │ │ dreamer = <main.dreamWorld object at 0x3083bfd90> │ │ │ │ self = <GUI.gradioGUI.Render object at 0x30b0d2f50> │ │ │ ╰────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ AttributeError: 'Button' object has no attribute 'style'`

Eufalesio commented 7 months ago

I will try upgrading Gradio

Edit: upgrade unsuccessful, instead downgrading to Gradio 3.50.2 fixes all issues, have not tested with other versions of Gradio 4

soten355 commented 7 months ago

Noted! Looks like the Gradio update changed how styles are managed. Trying to update the MetalDiffusion code now.

I'll fix the issue with the GUI so it works with Gradio. For now, I'll update the requirements.txt to Gradio 3.50.2 to temporarily fix the issue.