Hello,
As a Django Developer, I am currently facing a problem with generating avatars based on the leisure activity depicted in the user’s picture using OpenAI. I have attempted to use OpenAI to generate the avatars, but have not been able to achieve the desired results. I am seeking guidance or assistance on how to approach and solve this problem.
def generate_images(request):
if request.method == "POST":
images1 = request.FILES.get('image')
activity1 = request.POST.get('activity1')
activity2 = request.POST.get('activity2')
PROMPT = f"1. Upload a photograph of an individual.\n\n{image}\n\n2. Enter two leisure activities of their choice in unrestricted text format. Examples of these activities could include {activity1}, {activity2}, or any other activity of their choice.\n\n{activity1}\n\n{activity2}\n\n3. Generate two digital avatars of the person photographed by the user based on the specified activities."
response = openai.Image.create(
prompt=PROMPT,
n=1,
size="512x512",
)
print(response["data"][0]["url"])
return render(request, "index.html")