fix: consider compatibility with A1111
parent
2ed987364b
commit
a16522d61f
|
|
@ -1,9 +1,21 @@
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
if __package__ is None or __package__ == '':
|
||||||
|
# A1111 style (standalone script or direct module execution)
|
||||||
|
# Use absolute imports for compatibility with A1111 WebUI environment
|
||||||
|
from csv_reader import *
|
||||||
|
from random_functions import *
|
||||||
|
from one_button_presets import OneButtonPresets
|
||||||
|
from superprompter.superprompter import *
|
||||||
|
else:
|
||||||
|
# ComfyUI style (imported as a package)
|
||||||
|
# Use relative imports for proper integration with ComfyUI
|
||||||
from .csv_reader import *
|
from .csv_reader import *
|
||||||
from .random_functions import *
|
from .random_functions import *
|
||||||
from .one_button_presets import OneButtonPresets
|
from .one_button_presets import OneButtonPresets
|
||||||
from .superprompter.superprompter import *
|
from .superprompter.superprompter import *
|
||||||
|
|
||||||
OBPresets = OneButtonPresets()
|
OBPresets = OneButtonPresets()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,14 @@ import os
|
||||||
import random
|
import random
|
||||||
import torch
|
import torch
|
||||||
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
||||||
|
|
||||||
|
if __package__ is None or __package__ == '':
|
||||||
|
# A1111 style (standalone script or direct module execution)
|
||||||
|
# Use absolute imports for compatibility with A1111 WebUI environment
|
||||||
|
from download_models import download_models
|
||||||
|
else:
|
||||||
|
# ComfyUI style (imported as a package)
|
||||||
|
# Use relative imports for proper integration with ComfyUI
|
||||||
from .download_models import download_models
|
from .download_models import download_models
|
||||||
|
|
||||||
global tokenizer, model
|
global tokenizer, model
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue