Pierre Viéville
Forum Replies Created
-
Hello Clément and thanks a lot for your purchase !
I have answered you by e-mail ??
For the product you purchased, it is for those who:
– already have a license key and who wish to have the plugin without having to buy a duplicate license
– for those who do not need a license and who use dalle-2 for example to sell designs/simple patterns (wallpaper, etc.) Or dalle-3 for 1 image (digital art or something else to sell)
Hello clem301 !
I’ll try to do an update soon for AIG because it needs some improvment and code adaptation. Could be a new parameter in the shortcode but not in the snippet.
For the paid version, I wrapped it up inside a wordpress plugin, improved the code, the UX and i did a “live preview version” which works like this:
- You have a blank frame or a t-shirt to sell
- You can set up a basic customization area inside the main image of the product (via a mask build on photoshop or directly throught AIG premium)
- And on the front product page when the user generate images, he can click on each image to preview the rendering on the product itself
It is globally a very simple “live product designer”.
Note that if you need more than 1 image per request with dall-e 3 and the tool to create the mask you need an AIG Licence key too. I bundled this 2 products inside 1 on AIG website so you can setup all this independant things together.
Have a nice day,
Super ! ?a m’a l’air de bien fonctionner ?? Au plaisir d’avoir pu vous aider. Je vous souhaite de bonnes ventes, et merci encore d’utiliser Artist Image Generator !
No problem, glad to help !
I see what you are trying to do when visiting your website and your Woocommerce product page.
Do you need to add a customization field to the product you sell ? E.g, AI generation tool which let the user to generate images and use 1 image as a customized attribute for each product, then retrieve it in each product order ?
If so, i don’t know the way you want to handle it, but I can provide you a solution that you can adapt in your code (add CSS, customize, that’s an exemple)
https://github.com/Immolare/artist-image-generator/discussions/30-> If not working, try adding and attribute “custom image” with value “foo” inside your product, then retry with the same code
If the solution does not match, the code provide an exemple of all the functions you need to upload the AIG image of the user, set media metadatas and woocommerce metadata, and retrieve theses meta inside each order.
Basically to set WooCommerce metadata for each product, you need to work with :// Add custom metadata to the order item when creating the order add_action('woocommerce_checkout_create_order_line_item', function($item, $cart_item_key, $values, $order) { if (isset($values['custom_aig_image_id'])) { $item->add_meta_data('custom_aig_image_id', $values['custom_aig_image_id']); $image_src = wp_get_attachment_image_src($values['custom_aig_image_id'], 'full'); if ($image_src) { $item->add_meta_data('custom_image', esc_url($image_src[0])); } } }, 10, 4);
To retrieve an image by IP in WC dashboard order, just edit the function “display_custom_image_in_admin_order“, get the order IP and loop images which have same (downloaded_by or ip_address)
Have a nice day ! And thanks for your rating ??Hello Clem301,
I’m answering in english as it will be useful for everyone
I can’t edit the plugin to do such a task as it is verify specific to you. Anyways, here is a workaround. The idea is to override the download buttons event on data-download=”manual” form, and bind another event which will do an ajax request to save the image. You can do that in javascript.
So, to have a clean code you need to edit the function.php file of your child-theme (as it will keep the code after theme updates) then add / edit this script and reload.
Please visit the Github link and copy/paste the entire code :https://github.com/Immolare/artist-image-generator/discussions/29
It will do the following things :
– Handle download buttons events if the “aig” shortcode is present on the page and the shortcode is set as “manual download”
– Remove current listeners and bind new ones
– In each new listeners, on click, trigger “custom_aig_manual_download” function through an ajax request on the server
– Next, “custom_aig_manual_download” will get the image url and save it via “media_sideload_image” to the WordPress Media Library
– Then, get the current_user_id or the user_ip and set it as media metadata.
– Hide the button when the image is downloaded inside WordPress
Currently the metadata is saved with the name “downloaded_by“, but you can change it as you need. You can also retrieve it later this way for each media :$attachment_id = {your_media_id};
$user_ip_or_id = get_post_meta($attachment_id, 'downloaded_by', true);
Is it working for you ? ??
Note: You can adapt the code as you want, but the process still the same for all cases
If your issue is resolved, feel free to rate this plugin ! Have a nice day,Hello Clem301,
I did the development. Let me know if it works for you :1. update AIG to v1.1.2
2. in the shorcode, set the parameter : user_limit=”3″ for 3 requests only
3. set the parameter : user_limit_duration=”3600″ for 3 requests only per hour for example. The value needs to be in seconds
By default user_limit = “0” (unlimited) and user_limit_duration = “0” (lifetime), so you can set limitations the way you want.
The limitation is checked by IP if not connected, and by ID else. Datas are saved inside transients in database. Transients expiration = user_limit_duration.Transients will be deleted by WordPress automatically when expired, except when user_limit_duration is set as “0” (lifetime).
The limitation is global and not by shortcode, let me know if you need the limitation by shortcode ??
Hope it will works ! Feel free to rate the plugin on WordPress, to give more visibility !Hey clem301 !
Thanks first for your question. I’m gonna develop this functionnality wich is useful for everyone. Should be something like that :
in the shortcode 2 news params:
– “user_limit”: number, default 0 (no limitation)
– “user_limit_duration”: number, default 0 (no refresh) = refreshed every X hours
The functionnality will check IPs to handle both connected / non connected users.
I’ll let you know here asap in the next daysMerci encore une fois Théo pour l’aide que vous avez apporté, ainsi que pour la note !
Resolved with custom dev
Issue resolved in 1.0.15
Thanks to Théo for the feedback and help about this bug.
For users experencing the same issue, the bug is related to Apple devices only on edit mode (pro feature). It is due to Retina images which scale x2 the fabric canvas. Please upgrade to the latest version 1.0.15 to fix the problem.
Bonjour @theoportal !
Merci tout d’abord d’avoir acheté une licence pour mon plugin !
Concernant le problème, votre process pour semble être le bon et à priori Dall-E retourne bien des images si vous avez des résultats (à noter que si l’API OpenAI retourne une erreur quelconque vous devriez avoir une alerte en rouge).
Quelques petites pistes que je verrai :
– Essayez éventuellement avec une autre image pour voir si le problème est le même (détourez bien le sujet puis, dans le prompt essayez avec un texte simple en anglais du style “The character is in a winter background”)
—> Il se peut que le prompt soit trop compliqué ou mal interprété par l’IA par rapport au masque que vous avez entré
– J’ai vu qu’il y avait un petit soucis avec les tailles en pixels : l’API d’édition ne prend en charge que le modèle Dall-E 2 pour le moment. De ce fait le formats à utiliser sont 256, 512 et 1024 (1024×1792 et 1792×1024 sont pour Dall-E 3). Je vais faire un correctif bient?t à ce sujet, mais si c’était le soucis vous auriez du avoir un message d’alerte.
– Ou alors, c’est qu’il y a un bug au niveau du masque mais je n’ai pas eu de retour sur la chose pour le moment.
N’hésitez pas à m’envoyer une vidéo / screenshots au cas où à [email protected] si cela ne fonctionne toujours pas, et je regarde cela avec plaisir !En vous souhaitant une bonne fin de journée, et merci encore !
Hello ! Thanks for choosing Artist Image Generator. That’s a great idea. I’ll try to integrate this kind of feature for the next update. Could be nice to auto compress and convert into next gen image format like .webp !
Thanks for your comment and rating !