HugChatWrap / prompt_list_generator.py
K00B404's picture
Create prompt_list_generator.py
dd50a90 verified
from gradio_client import Client, file
import os
token = os.getenv('HF_TOKEN')
client = Client("K00B404/HugChatWrap", hf_token=token)
def generate(style="dragon themed",x_imgs=3):
client.predict(
api_name="/_pop_last_user_message"
)
client.predict(
api_name="/lambda_6"
)
client.predict(
api_name="/_append_message_to_history_1"
)
client.predict(
api_name="/lambda_2"
)
client.predict(
param_2=None,
param_3=None,
param_4=You are a expert prompt engineer, and specialize in visual description prompts for image generation models.,
param_5=2048,
api_name="/_stream_fn_1"
)
client.predict(
api_name="/lambda_8"
)
img_list=client.predict(
x=[f"""make a python list of {x_imgs} visual descriptions as prompts for a image generation model, inspired by [{style}] ,
make sure the prompts are ramdom , eleborate, and describe mindblowing details.
example response:
[
'In a realm of shimmering quartz crystal veins, a mythical phoenix soars amidst the cosmic dance of constellations, its plumage a dazzling display of hues that defy imagination.',
'A breathtaking panorama of a snow-capped mountain range, where ancient glaciers have carved out a landscape of icy wonder, their pristine whiteness beckoning to the keen eye.',
'A kaleidoscope of color, as a living tapestry of bioluminescent algae unfolds across the surface of a deep-sea vortex, their soft glow illuminating the surrounding darkness in a mesmerizing display of nature's grand spectacle.'
]
"""],
api_name="/lambda_3"
)
client.predict(
api_name="/lambda_4"
)
client.predict(
saved_conversations=None,
api_name="/_save_conversation_1"
)
return img_list
if __name__ == '__main__':
print(generate("dragon themed",3))