mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
1.0.55
This commit is contained in:
+12
-1
@@ -3,6 +3,15 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, set_seed
|
|||||||
from modules.path import fooocus_expansion_path
|
from modules.path import fooocus_expansion_path
|
||||||
|
|
||||||
|
|
||||||
|
magic_split = [
|
||||||
|
', extremely',
|
||||||
|
', by',
|
||||||
|
', trending',
|
||||||
|
', best',
|
||||||
|
'. ',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def safe_str(x):
|
def safe_str(x):
|
||||||
x = str(x)
|
x = str(x)
|
||||||
for _ in range(16):
|
for _ in range(16):
|
||||||
@@ -22,9 +31,11 @@ class FooocusExpansion:
|
|||||||
print('Fooocus Expansion engine loaded.')
|
print('Fooocus Expansion engine loaded.')
|
||||||
|
|
||||||
def __call__(self, prompt, seed):
|
def __call__(self, prompt, seed):
|
||||||
prompt = safe_str(prompt) + '. ' # Reduce semantic corruption.
|
|
||||||
seed = int(seed)
|
seed = int(seed)
|
||||||
set_seed(seed)
|
set_seed(seed)
|
||||||
|
|
||||||
|
prompt = safe_str(prompt) + magic_split[seed % len(magic_split)]
|
||||||
|
|
||||||
response = self.pipe(prompt, max_length=len(prompt) + 256)
|
response = self.pipe(prompt, max_length=len(prompt) + 256)
|
||||||
result = response[0]['generated_text']
|
result = response[0]['generated_text']
|
||||||
result = safe_str(result)
|
result = safe_str(result)
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
### 1.0.55
|
### 1.0.55
|
||||||
|
|
||||||
|
* Begin to use magic split.
|
||||||
|
|
||||||
|
### 1.0.55
|
||||||
|
|
||||||
* Minor changes of Prompt Expansion.
|
* Minor changes of Prompt Expansion.
|
||||||
|
|
||||||
### 1.0.52
|
### 1.0.52
|
||||||
|
|||||||
Reference in New Issue
Block a user