mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
feat: read size and ratio of an image and provide the recommended size (#2971)
* Add the information about the size and ratio of the read image * feat: use available aspect ratios from config, move function to util, change default visibility of label * refactor: extract sdxl aspect ratios to flags, use in describe as discussed in https://github.com/lllyasviel/Fooocus/pull/2971#discussion_r1608493765 https://github.com/lllyasviel/Fooocus/pull/2971#issuecomment-2123620595 --------- Co-authored-by: Manuel Schmid <dev@mash1t.de> Co-authored-by: Manuel Schmid <9307310+mashb1t@users.noreply.github.com>
This commit is contained in:
co-authored by
Manuel Schmid
Manuel Schmid
parent
7537612bcc
commit
302bfdf855
@@ -124,7 +124,7 @@ def get_resolution(key: str, fallback: str | None, source_dict: dict, results: l
|
||||
h = source_dict.get(key, source_dict.get(fallback, default))
|
||||
width, height = eval(h)
|
||||
formatted = modules.config.add_ratio(f'{width}*{height}')
|
||||
if formatted in modules.config.available_aspect_ratios:
|
||||
if formatted in modules.config.available_aspect_ratios_labels:
|
||||
results.append(formatted)
|
||||
results.append(-1)
|
||||
results.append(-1)
|
||||
|
||||
Reference in New Issue
Block a user