Giter Site home page Giter Site logo

Comments (19)

laksjdjf avatar laksjdjf commented on June 23, 2024 1
  1. PFG scale is similar to prompt emphasis by ()[]. PFG scale affects only the image, and cfg scale affects both the image and the prompt.
  2. Negative PFG can be implemented, but it is not clear if it will give better results than negative embedding. I will try it as it sounds interesting.
  3. You can convert a style by providing prompts or LoRAs that represent the style.

from pfg-webui.

laksjdjf avatar laksjdjf commented on June 23, 2024

Can you import tensorflow for normal python code?

For example in cmd.

$python3
>>>import tensorflow

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

OK sorry I finally managed to copy paste a number of libs from an old copy of SD-WEBUI, that I could'nt manage to get done since this morning. I really must have mismanaged my libraries one way or another and shall reinstall everything from scratch... Mhh... Nevertheless, I now get your extension in txt2img. let's try it

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

Oups

Not enough GPU hardware devices available
2023-02-28 16:02:28.512160: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING:tensorflow:No training configuration found in save file, so the model was not compiled. Compile it manually.
Data shape for DDIM sampling is (1, 4, 64, 64), eta 0.0
Running DDIM Sampling with 31 timesteps
DDIM Sampler: 100%|████████████████████████████████████████████████████████████████████| 31/31 [00:10<00:00, 2.90it/s]

Do you know what does that mean ? Me not really...

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

I don't seem to get anything related to the input image. My implementation might not be fully functional (what a surprise)

from pfg-webui.

laksjdjf avatar laksjdjf commented on June 23, 2024

Did you merge it ?

In any case, it is not good that there is no message to confirm that it has been applied. I will fix that.

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

Yes I merged manually your PR in webui

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

The problem is probably with my installation I'll try to reinstall everything from scratch later. Don't mind me :-)

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

fresh install. I had to add
tensorflow==2.12.0rc0
protobuf==3.20.3
to requirements_versions.txt in order for everything to be compatible.
finally...
Not enough GPU hardware devices available
Error running process: C:\AI\AAA\SD2\stable-diffusion-webui\extensions\pfg-webui\scripts\pfg-webui.py
Traceback (most recent call last):
File "C:\AI\AAA\SD2\stable-diffusion-webui\modules\scripts.py", line 386, in process
script.process(p, *script_args)
File "C:\AI\AAA\SD2\stable-diffusion-webui\extensions\pfg-webui\scripts\pfg-webui.py", line 118, in process
self.tagger = load_model(os.path.join(CURRENT_DIRECTORY, TAGGER_DIR))
File "C:\AI\AAA\SD2\stable-diffusion-webui\venv\lib\site-packages\keras\saving\saving_api.py", line 212, in load_model
return legacy_sm_saving_lib.load_model(
File "C:\AI\AAA\SD2\stable-diffusion-webui\venv\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\AI\AAA\SD2\stable-diffusion-webui\venv\lib\site-packages\tensorflow\python\trackable\data_structures.py", line 823, in getattribute
return super().getattribute(name)
TypeError: this dict descriptor does not support '_DictWrapper' objects

from pfg-webui.

laksjdjf avatar laksjdjf commented on June 23, 2024

I recommend to use tensorflow<=2.11.
There seem to be some dependency conflicts, but it works.

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

Same error after changing tensorflow to 2.11.0, same with 2.9.1. It must be some other module version that is not good.

from pfg-webui.

laksjdjf avatar laksjdjf commented on June 23, 2024

The problem seems to be confirmed in 2.12rc, but if it still happens after downgrading to 2.11 or lower, it may be due to other dependent libraries.

tensorflow/tensorflow#59869

from pfg-webui.

laksjdjf avatar laksjdjf commented on June 23, 2024

The version of the wrapt library seems to be relevant.

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

FYI, I tried downgrading wrapt from 2.15.0 to 2.11.0 as what seems to be suggested from your link but the exact same error is still there. I hope other people trying out your extension will have more luck with their installed libraries and will report success.

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

After pip install tf-nightly, it seems to go a little further :
Error running process: C:\AI\AAA\SD2\stable-diffusion-webui\extensions\pfg-webui\scripts\pfg-webui.py
Traceback (most recent call last):
File "C:\AI\AAA\SD2\stable-diffusion-webui\modules\scripts.py", line 386, in process
script.process(p, *script_args)
File "C:\AI\AAA\SD2\stable-diffusion-webui\extensions\pfg-webui\scripts\pfg-webui.py", line 104, in process
pfg_weight = torch.load(os.path.join(CURRENT_DIRECTORY, "models/" + pfg_path))
TypeError: can only concatenate str (not "list") to str

EDIT: Actually i forgot to specify the model in the listbox. When done, I get the previous error again...

from pfg-webui.

laksjdjf avatar laksjdjf commented on June 23, 2024

I added the option to use onnxruntime, it may work without tensorflow.
https://onnxruntime.ai/

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

Thank you. after updating your extension and restarting completely the webui so as to let onxx model download itself during start, I can confirm this works fine for WD1.4. It works with WD1.5 too.

I notice pfg's scale doesn't seems to have any effect.
Moreover, about number of tokens : only '10' is working. I encounter weird errors using any other number.

from pfg-webui.

laksjdjf avatar laksjdjf commented on June 23, 2024

Thanks for the report !
I forgot the code to apply pfg_scale and I already added it :)

The number of tokens is determined by one value per pfg file". The last 10 in "pfg-wd14-n10" is the number of tokens.

from pfg-webui.

Ehplodor avatar Ehplodor commented on June 23, 2024

It works. GG

I tried your WD15 version too. Can't say for the moment if better or not than WD14. Probably better but not enough testing.

The image's embedding seems very strong in comparison to text's embedding. As you said in the readme/Hints, I had to tune up up up the text cfg scale, using cfg treshold extension, and lower image's pfg to 0.65-70 in order to get somehow good results. Also, pfg = 3 destroyed everything :-)

Some questions pop up from those early tests :

  • First question : In your understanding, is PFG more comparable to the "strength" parameter of the img2img tab ? or is it more similar to CFG scale ?
  • Another question : would it be conceivable to use an image with negative PFG so as to substract it from the latents, similar to negative embedding but as an image ?
  • Last question : can your extension be used for style transfer ?

from pfg-webui.

Related Issues (2)

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.