Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Improved Negative Prompt Support for Anime, Paintings and Other Non-Photographic Media #2481

Closed
1 task done
DavidDragonsage opened this issue Mar 8, 2024 · 5 comments · Fixed by #2492
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@DavidDragonsage
Copy link
Contributor

DavidDragonsage commented Mar 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What would your feature do?

Currently the Anime preset uses Fooocus Negative in its default_styles list. This is an unfortunate choice in that Fooocus Negative suppresses "anime", as well as "drawing, painting, crayon, sketch, graphite, impressionist, noisy... cartoon, graphic, text, painting, crayon, graphite, abstract" (yes, "painting" is listed twice).

Fooocus Enhance is a somewhat better choice for non-photographic negative prompting in that it does not suppress "painting", but it does have "(airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1)" in its no-fly zone.

Apart from that, Fooocus Enhance contains a lot of suppression that is really valuable for semi-realistic art, such as "bad anatomy", "watermark", "cropped", etc.

My proposal is to have a version of the Fooocus Enhance style in which the words "airbrushed" through to "3D Character" were removed. Perhaps this new style could be called "Fooocus Semi-Realistic".

Proposed workflow

  1. Open sdxl_styles_fooocus.json in the script editor of your choice (I use Brackets)
  2. Make a copy of the "Fooocus Enhance" text and insert it with the name "Fooocus Semi-Realistic"
  3. Remove the words "(airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), " from the new style
  4. Save and test
  5. Open anime.json in a script or text editor
  6. In the default_styles section, replace "Fooocus Negative" with "Fooocus Semi-Realistic"
  7. Save and test
  8. Add an appropriate cat image to the samples folder
  9. Test if the new popup image works in the Style selector pane

Additional information

I am an experienced programmer, but not in Python. This is however a very basic change and I would be happy to implement it if you wish. It is possible that the total number of Styles is a fixed number that would need to be adjusted. Thank you for taking a look at this!

@DavidDragonsage DavidDragonsage added enhancement New feature or request triage This needs an (initial) review labels Mar 8, 2024
@mashb1t
Copy link
Collaborator

mashb1t commented Mar 8, 2024

Feel free to modify the styles to your liking and provide a PR with the changes, which are then going to be benchmarked/evaluated.

@mashb1t mashb1t removed the triage This needs an (initial) review label Mar 8, 2024
@DavidDragonsage
Copy link
Contributor Author

I was not able to initiate a Pull Request. This was the error message: "Pull request creation failed. Validation failed: must be a collaborator"

I have attached the whole package as a zip. Within the zip, "Improved Negative Prompt Support for Anime.txt" is the core text that would have formed the PR. The files sdxl_styles_fooocus.json, anime.json, and fooocus_semi_realistic.jpg are the files to be changed or added, and the PNGs serve as supporting documentation for the testing phase of the project.

Improved Support for Anime & Paintings.zip

@mashb1t
Copy link
Collaborator

mashb1t commented Mar 10, 2024

@DavidDragonsage a PR can be created by forking this repository, committing your changes and then creating the PR from it.
Will have a look tomorrow!

@DavidDragonsage
Copy link
Contributor Author

Thank you! I feel like I just performed something miraculous, but I think I've successfully created a PR! :)
(I followed up on your suggestion to create a fork in this repository)

@DavidDragonsage
Copy link
Contributor Author

DavidDragonsage commented Mar 11, 2024

Today I revised the proposed Fooocus Semi Realistic style with a new commit. This revision removes the text "grayscale, bw," so that other semi realistic styles besides painting and anime are supported. This would allow for media such as sketches, black and white photos, and greyscale printing to be supported with the large collection of other useful negatives that were in Fooocus Enhance - and are the basis for Fooocus Semi Realistic.

@mashb1t mashb1t added the good first issue Good for newcomers label Mar 11, 2024
@mashb1t mashb1t added this to the 2.3.0 (draft) milestone Mar 11, 2024
@mashb1t mashb1t closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
2 participants