Code Monkey home page Code Monkey logo

lightdiffusionflow's Introduction

sd-webui-lightdiffusionflow

English | 中文

This extension is developed for AUTOMATIC1111's Stable Diffusion web UI that provides import/export options for parameters.
"Stable Diffusion Web UI" hereafter referred to as "SD Web UI"

Capabilities

  • Export/Import web UI parameters with a single file (images, inputs, sliders, checkboxes etc.) .
  • Support parsing png info from image and restoring parameters back to the web UI.
  • Supported extensions:
    • In theory, it can support any plugin. (Except for certain plugin images, as they require the corresponding elem_id to be provided.)

lightflow_en

Install

Use Install from URL option with this repo url.

Requirements

None at all.

Usage

  • Export Parameters:
    In the SD Web UI, configure the desired options, and click the "Export" button to export a flow file that records the current parameters.

  • Import Parameters:
    In the SD Web UI, click the "FileBox", select the corresponding flow file, and import the parameters from the file. You can also directly drag and drop the flow file into the "FileBox" for importing.

Currently, the plugin supports SD WebUI versions v1.5 and above, and compatibility testing for earlier versions has not been conducted.
If not due to compatibility issues with essential functionalities, it is strongly recommended to upgrade to version v1.6 or above before using this plugin!

Examples

You can find several official examples in the example/ folder. If you want to try out more possibilities, please visit Our open-source community for more public examples.

Contributing

If you have any comments, suggestions, or encounter issues with our project, please feel free to raise them through an issue, and we also welcome pull requests at any time!
You are also more than welcomed to share your own LightDiffusionFlow on Our open-source community.

Credits

Licenses for borrowed code can be found in LICENSES/Licenses.md

  • stable-diffusion-webui-state - https://github.com/ilian6806/stable-diffusion-webui-state

    Our team urgently needs a solution to easily share the Stable Diffusion Web UI settings, and Ilian Iliev's stable-diffusion-webui-state project has been a great help to us. Thank you, Ilian Iliev!

  • Big thanks to Hali for the inspiration, suggestions, and various forms of support during the development of this project. Much appreciated!

lightdiffusionflow's People

Contributors

design61 avatar legionfu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lightdiffusionflow's Issues

导出的参数不完整

界面上设置了一些高清修复的参数,但是导出后的文件中缺少了这些参数。负面提示词其他基本参数也缺失。
image

导出文件内容:

{
    "state-txt2img_seed": "2143176020",
    "state-txt2img_height": "450",
    "state-txt2img_sampling": "Euler a",
    "state-txt2img_enable_hr": "true",
    "state-txt2img_styles": "",
    "state-txt2img_hr_upscaler": "R-ESRGAN 4x+ Anime6B",
    "state-tab": "图库浏览器Image Browser ",
    "state-setting_sd_model_checkpoint": "gcmWhiteanime_v30.ckpt [efb35e1eb0]",
    "state-txt2img_#script_list": "None",
    "state-txt2img_prompt": "masterpiece, best quality, extremely detailed, ..."
}

补充一下,这些参数是通过图库浏览器中通过 “发送文生图” 按钮导入过来的。
image

【建议】能否增加一个直接传递参数的 API

亲爱的作者,能否增加一个直接传递 flow 文件里面的参数,然后返回解析后的 sd 参数的 API,因为我有一种自动化的需求需要用到 flow 文件,但是目前的 read_file API 只能通过点击上传文件后才能识别此文件

"Upscaler for img2img" and other configuration methods to be incorporated into flow

As an example, to set Upscaler for img2img, in a1111 specify Settings -> Upscaling -> Upscaler for img2img -> "LDSR".

As you know, Upscaling outputs different results depending on the model.

Do you plan to specify the exact method of Upscaling?
I mean to incorporate the contents of the Settings into the flow.

Of course, this could be done using comfyUI, but it was difficult for me to learn, so I am asking here: 😵‍💫

Translated with www.DeepL.com/Translator (free version)

inport error

fn_import_workflow /tmp/gradio/b93478f7d7fad911c5cb4ef45961a93dc6c8b52e/ipadapter0.6-768hirefix1.2.flow
Reusing loaded model 摄影-Photon_v1.safetensors [ec41bd2a82] to load 摄影-墨幽人造人_v1040精简.safetensors [ea8e801c3a]
Loading weights [ea8e801c3a] from /root/autodl-tmp/stable-diffusion-webui/models/Stable-diffusion/摄影-墨幽人造人_v1040精简.safetensors
Applying attention optimization: xformers... done.
Weights loaded in 2.2s (send model to cpu: 0.9s, load weights from disk: 0.7s, apply weights to model: 0.1s, move model to device: 0.3s).
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.10/site-packages/gradio/routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "/root/miniconda3/lib/python3.10/site-packages/gradio/blocks.py", line 1431, in process_api
result = await self.call_function(
File "/root/miniconda3/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "/root/miniconda3/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/root/miniconda3/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/root/miniconda3/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/root/miniconda3/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "/root/autodl-tmp/stable-diffusion-webui/extensions/LightDiffusionFlow/scripts/state_api.py", line 137, in set_dropdowns
res = re.search(r"([[0-9A-Fa-f]{8,10}])", new_value)
File "/root/miniconda3/lib/python3.10/re.py", line 200, in search
return _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object
ipadapter0.6-768hirefix1.2.flow.zip

ModuleNotFoundError: No module named 'scripts.lightdiffusionflow_config'

当scripts目录下有多个py模块文件时,python文件会提示下面错误,怎么解决这个问题,试了各种方法不行。
包括增加sys.path.appent(''),
使用__init__.py可以临时解决,但是如果其他插件也是在scripts目录有多个问题,第一个使用的有效,其他的就不能使用
*** Error loading script: state_api.py
Traceback (most recent call last):
File "/mnt/p/home/flyang/stable-diffusion-webui/modules/scripts.py", line 381, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/mnt/p/home/flyang/stable-diffusion-webui/modules/script_loading.py", line 12, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/mnt/p/home/flyang/stable-diffusion-webui/extensions/LightDiffusionFlow/scripts/state_api.py", line 26, in
from scripts import lightdiffusionflow_version, lightdiffusionflow_config
ImportError: cannot import name 'lightdiffusionflow_version' from 'scripts' (/home/flyang/.local/lib/python3.10/site-packages/scripts/init.py)


*** Error loading script: state_settings.py
Traceback (most recent call last):
File "/mnt/p/home/flyang/stable-diffusion-webui/modules/scripts.py", line 381, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/mnt/p/home/flyang/stable-diffusion-webui/modules/script_loading.py", line 12, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/mnt/p/home/flyang/stable-diffusion-webui/extensions/LightDiffusionFlow/scripts/state_settings.py", line 4, in
from scripts.lightdiffusionflow_config import OutputPrompt
ModuleNotFoundError: No module named 'scripts.lightdiffusionflow_config'

支持这个项目!反馈一些使用感受。

首先感谢大佬。
每次都要配参数是很多人换Comfyui的原因,这个项目正式解决之道,非常棒。

几点反馈:
1、跟stable-diffusion-webui-state有冲突,不能并存
2、当调整很多参数以后,保存下来的文件中可以看出同一个参数反复出现很多条,并且值都不一样
3、还有很多参数没有记录,比如ultimate upscale,和img2img的batch处理等等

祝项目原来越好!

能否增加一个本地保存功能

我看导出的flow只有几百个字节,只是自己保存工作流,文件到处塞麻烦,不如再加个写indexeddb或者localStorage的功能。
需要自己保存自己的方案,只需要存本地。
需要分享的时候再导出成文件,这样用起来更爽。

Is it possible to have multiple workflows as a single lightflow?

How can I make the following example a single lightflow or in some way a lightflow?

  1. generate with txt2img
  2. generate the generated image with img2img and set Scale:2 in "Resize by".

I usually use the above method when generating images.

The reason I don't use Hires. fix is that I generate about 100 images with txt2img and upscale only the good ones with img2img to avoid waste.

The above is just an example, but how should we use lightflow to deal with the generation method using multiple tabs like txt2img → img2img?

Various advices are welcome!

--

Use comfyUI? This was very difficult for me 😢

能否增加一个备注或者注释的功能选项?

每次在保存工作流的时候,需要去思考如何命名更能让自己或别人能看懂,而有些经验的东西是无法通过工作流配置文件保存下来的,于是建议新增一个备注或者注释的功能,这样别人在使用的时候可以看到作者的一些经验备注,也更方便他人使用

export button is sleeping..

Hi, could you please advise me how to work with the plugin?
When I hit export (after generation and selected image), nothing happens.
Everything is updated.
startup log:

Requirement already satisfied: pip in x:\visions_of_chaos\py\lib\site-packages (23.3.2)
venv "X:\Visions_of_Chaos\MLF\Text To Image\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
Version: v1.7.0
Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e
Launching Web UI with arguments: --share --no-half-vae --xformers --autolaunch
Style database not found: X:\Visions_of_Chaos\MLF\Text To Image\stable-diffusion-webui\styles.csv
X:/Visions_of_Chaos/MLF/Text To Image/stable-diffusion-webui/models/LightDiffusionFlow
[-] ADetailer initialized. version: 23.11.1, num models: 9
ControlNet preprocessor location: X:\Visions_of_Chaos\MLF\Text To Image\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-12-31 11:28:49,962 - ControlNet - �[0;32mINFO�[0m - ControlNet v1.1.423
2023-12-31 11:28:50,049 - ControlNet - �[0;32mINFO�[0m - ControlNet v1.1.423
sd-webui-prompt-all-in-one background API service started successfully.
Loading weights [a21c9949ef] from X:\Visions_of_Chaos\MLF\Text To Image\stable-diffusion-webui\models\Stable-diffusion_SDXL_1_0\thinkdiffusionxl_v10.safetensors
LightDiffusionFlow 绑定完�
Creating model from config: X:\Visions_of_Chaos\MLF\Text To Image\stable-diffusion-webui\repositories\generative-models\configs\inference\sd_xl_base.yaml
Running on local URL: http://127.0.0.1:7860
Applying attention optimization: xformers... done.
Model loaded in 6.6s (load weights from disk: 1.4s, create model: 0.9s, apply weights to model: 2.4s, apply dtype to VAE: 0.9s, move model to device: 0.1s, calculate empty prompt: 0.9s).

----------------- light_diffusion_flow api start------------------
Startup time: 25.0s (prepare environment: 5.0s, import torch: 2.1s, import gradio: 0.7s, setup paths: 0.6s, initialize shared: 0.2s, other imports: 0.5s, load scripts: 2.8s, create ui: 1.9s, gradio launch: 11.0s).

Thank you!

给模块的ui加特定id?

如题,想要对这个插件的ui部分进行修改时,由于没有特定的id(而是浏览器自带的component-xxx),很难找到对应位置并进行修改。
ui修改建议

Tasks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.